Debian11 / gvm 22.4: gvmd.service: Can't open PID file /run/gvmd/gvmd.pid (yet?) after start: Operation not permitted

Dear All,
after installation (strictly) following https://greenbone.github.io/docs/latest/22.4/source-build/index.html#, I’m facing an issue when starting gvmd service:
~$ sudo systemctl status gvmd.service

● gvmd.service - Greenbone Vulnerability Manager daemon (gvmd)
Loaded: loaded (/etc/systemd/system/gvmd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-01-23 17:53:09 CET; 17h ago
Docs: man:gvmd(8)
Process: 137836 ExecStart=/usr/local/sbin/gvmd --osp-vt-update=/run/ospd/ospd-openvas.sock --listen-group=gvm (code=exited, status=0/SUCCESS)
Main PID: 137837 (gvmd)
Tasks: 1 (limit: 154500)
Memory: 148.5M
CPU: 1min 23.559s
CGroup: /system.slice/gvmd.service
└─137837 gvmd: gvmd: Waiting --osp-vt-update=/run/ospd/ospd-openvas.sock --listen-group=gvm

Jan 23 17:53:08 srv0516 systemd[1]: Starting Greenbone Vulnerability Manager daemon (gvmd)…
Jan 23 17:53:08 srv0516 systemd[1]: gvmd.service: Can’t open PID file /run/gvmd/gvmd.pid (yet?) after start: Operation not permitted
Jan 23 17:53:09 srv0516 systemd[1]: Started Greenbone Vulnerability Manager daemon (gvmd).

install was done on Debian 11:
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

when having a look to file permission in /var/run/gvmd:
$ ll /var/run/gvmd/
total 4
-rw-rw-r-- 1 gvm gvm 0 Jan 23 17:53 gvm-checking
-rw-rw-r-- 1 gvm gvm 0 Jan 23 17:53 gvm-create-functions
-rw------- 1 gvm gvm 7 Jan 23 17:53 gvmd.pid
srw-rw---- 1 gvm gvm 0 Jan 23 17:53 gvmd.sock
-rw-rw-r-- 1 gvm gvm 0 Jan 23 17:53 gvm-helping
-rw-rw-r-- 1 gvm gvm 0 Jan 23 17:53 gvm-migrating
-rw-rw-r-- 1 gvm gvm 0 Jan 23 17:53 gvm-serving

error seems expected but I don’t understand how permission for gvmd.pid can be -rw------- only as others file permissions in same directory as correct (and apply settings
RuntimeDirectory=gvmd
RuntimeDirectoryMode=2775 from /etc/systemd/system/gvmd.service file

if I have a look to similar pid file for others gvm services, it is ok:
$ ll /var/run/ospd/
total 4
-rw-r–r-- 1 gvm gvm 5 Jan 20 17:38 ospd-openvas.pid
srwxrwx— 1 gvm gvm 0 Jan 20 17:38 ospd-openvas.sock
rndadmin@srv0516:~$

any idea welcome

thanks

Hi,

could you try changing the gvmd service file:

  • Use Type=exec instead of Type=forking
  • Add -f to the ExecStart line

It could be similar to https://github.com/greenbone/gsad/pull/84

1 Like

Hi, thanks a lot for your prompt answer, the issue seems now fixed

1 Like