GVM10 Start daemons at boot

Hi!
I’m trying to run the daemons at boot in debian9 but when I restart the system, the daemons not start.
This is my configuration:

/etc/systemd/system/openvas-manager.service

[Unit]
Description=Open Vulnerability Assessment System Manager Daemon
Documentation=man:gvmd(8) http://www.openvas.org/
Wants=openvas-scanner.service

[Service]
Type=forking
PIDFile=/usr/local/var/run/gvmd.pid
ExecStart=/usr/local/sbin/gvmd

[Install]
WantedBy=multi-user.target

/etc/systemd/system/greenbone-security-assistant.service

[Unit]
Description=Greenbone Security Assistant
Documentation=man:gsad(8) http://www.openvas.org/
Wants=openvas-manager.service

[Service]
Type=simple 
PIDFile=/usr/local/var/run/gsad.pid 
ExecStart=/usr/local/sbin/gsad --foreground --ssl-private-key=/home/erueda1/oncustomercom.key --ssl-certificate=/home/erueda1/oncustomercom.crt  
 
[Install] 
WantedBy=multi-user.target

/etc/systemd/system/openvas-scanner.service

[Unit]
Description=OpenVAS System Scanner Daemon
Documentation=man:openvassd(8) http://www.openvas.org/
After=redis-server.service
Requires=redis-server.service 
 
[Install] 
WantedBy=multi-user.target 

[Service]
Type=forking
PIDFile=/usr/local/var/run/openvassd.pid
ExecStart=/usr/local/sbin/openvassd

/etc/systemd/system/redis.service

[Unit] 
Description=Advanced key-value store 
After=network.target 
Documentation=http://redis.io/documentation, man:redis-server(1) 
 
[Service] 
Type=forking 
ExecStart=/usr/bin/redis-server /etc/redis/redis.conf 
PIDFile=/var/run/redis/redis-server.pid 
TimeoutStopSec=0 
Restart=always 
User=redis 
Group=redis 
RuntimeDirectory=redis 
 
ExecStartPre=-/bin/run-parts --verbose /etc/redis/redis-server.pre-up.d 
ExecStartPost=-/bin/run-parts --verbose /etc/redis/redis-server.post-up.d 
ExecStop=-/bin/run-parts --verbose /etc/redis/redis-server.pre-down.d 
ExecStop=/bin/kill -s TERM $MAINPID 
ExecStopPost=-/bin/run-parts --verbose /etc/redis/redis-server.post-down.d 
 
UMask=007 
PrivateTmp=no 
LimitNOFILE=65535 
PrivateDevices=yes 
ProtectHome=yes 
ReadOnlyDirectories=/ 
ReadWriteDirectories=-/var/lib/redis 
ReadWriteDirectories=-/var/log/redis 
ReadWriteDirectories=-/tmp 
ReadWriteDirectories=-/var/run/redis 
CapabilityBoundingSet=~CAP_SYS_PTRACE 
ProtectSystem=true 
ReadWriteDirectories=-/etc/redis 
 
[Install] 
WantedBy=multi-user.target 
Alias=redis.service

Anyone?

Thanks!

Привет!

Попробуй такой вариант

sudo crontab -e
@reboot ~/scripts/gsm.sh
mkdir ~/scripts
nano ~/scripts/gsm.sh

#! /bin/bash

/usr/local/sbin/gvmd
/usr/local/sbin/openvassd
/usr/local/sbin/gsad

sudo chmod +x ~/scripts/gsm.sh

The daemons gsad and openvassd starts but not gvmd.
I don’t know why, it not generate any logs. If I run /usr/local/sbin/gvmd it starts but not in boot :S

Hi,
since i do not know, how you installed and under which user you try to run things the following is just a guess:
Maybe take a look at the logfiles under /your/install/path/var/log/gvm/*.log first.
It seems as if there are permission problems.
You should never install or run under root :wink:
For your services you could try to fix the start scripts by adding:

[Service]
User=yourname
Group=yourgroup

and change ownership of the related files.
Maybe this is helpful to you

1 Like