Gvmd.service: Can’t open PID file /run/gvmd/gvmd.pid

Hi, I am also facing same issue. Initially the gsad.service and ospd-openvas.service are disabled and inactive, I activated and enabled them.

But still facing issue “gvmd.service: Can’t open PID file /run/gvmd/gvmd.pid (yet?) after start: Operation not permitted”

Please help me in resolving this.

Hi and welcome to our community!

I’ve moved your message to a new topic. It is best to open a new one in such cases.

1 Like

Sadly I was never able to reproduce this issue therefore I still don’t understand what’s going on here. Systemd should create the /run/gvmd/ directory with the correct permissions as stated in the service file. Thus please check the gvmd.service file first. It should contain the following lines

User=gvm
PIDFile=/run/gvmd/gvmd.pid
RuntimeDirectory=gvmd
RuntimeDirectoryMode=2775

Second you should check if /run/gvmd has the correct permissions via ls -l /run/gvmd. The owner should be the gvm user and not root for example.

I am still not sure if this error originates from gvmd or systemd.

1 Like

Hi @Siva_Laveti

check your unit

/etc/systemd/system/gvmd.service

It should look like this:

[Unit]
Description=Greenbone Vulnerability Manager daemon (gvmd)
After=network.target networking.service postgresql.service ospd-openvas.service
Wants=postgresql.service ospd-openvas.service
Documentation=man:gvmd(8)
ConditionKernelCommandLine=!recovery

[Service]
Type=forking
User=gvm
Group=gvm
PIDFile=/run/gvm/gvmd.pid
RuntimeDirectory=gvmd
RuntimeDirectoryMode=2775
ExecStart=/usr/local/sbin/gvmd --osp-vt-update=/run/ospd/ospd-openvas.sock --listen-group=gvm
Restart=always
TimeoutStopSec=10

[Install]
WantedBy=multi-user.target

The second check has to be the already running process that was not killed from previous tries.
ps -elf | grep gvm

1 Like

Sorry, no this is wrong. It needs to be PIDFile=/run/gvmd/gvmd.pid.

2 Likes

The current advice from our side can always be found at our docs (https://greenbone.github.io/docs/latest/22.4/source-build/index.html#starting-services-with-systemd for 22.4).

1 Like

2 posts were split to a new topic: Oops, secure memory pool already initialized

This could maybe caused by the same issue as Change service start up type from forking to exec by rfc6919 · Pull Request #84 · greenbone/gsad · GitHub but not for gvmd instead. Changing Type to exec and adding a --foreground to ExecStart may improve the situation.

1 Like

10 posts were split to a new topic: Gmvd service not starting after Kali update