Docker ospd-openvas not starting at boot

Hello,
I installed Greenbone Community Containers on Ubuntu 24.04, I setup SSL/TLS for GSA and everything works good.
After server reboot container starts automatically but looks ospd-openvas not starting, below message found in logs:
gvmd-1 | md manage:WARNING:2025-02-19 09h23.09 utc:89: osp_scanner_feed_version: failed to connect to /run/ospd/ospd-openvas.sock

Running command “docker compose ps” I can see below services running and looks greenbone-community-edition-ospd-openvas-1 is missing:

greenbone-community-edition-gsa-1
greenbone-community-edition-gvmd-1
greenbone-community-edition-openvas-1
greenbone-community-edition-openvasd-1
greenbone-community-edition-pg-gvm-1
greenbone-community-edition-redis-server-1

Running Container restart “docker compose -f $DOWNLOAD_DIR/docker-compose.yml up -d” all services starts including community-edition-ospd-openvas-1

greenbone-community-edition-gsa-1
greenbone-community-edition-gvmd-1
greenbone-community-edition-openvas-1
greenbone-community-edition-openvasd-1
greenbone-community-edition-ospd-openvas-1
greenbone-community-edition-pg-gvm-1
greenbone-community-edition-redis-server-1

Is it possible to set greenbone-community-edition-ospd-openvas-1 to start on server boot?

Thank you.

I think you can use scheduled bash script to verify that the containers are all up and running after a reboot and/or restart them after the boot process has completed. Otherwise, maybe competition for system resources during the boot that cause this issue since they always seem to come up for me when rebooting a VM with the containers installed on them.

This works on Debian (running in VM) for me:

  1. create script
    sudo nano /usr/local/bin/check_ospd.sh
#!/bin/bash

sleep 30  # wait 30s after systemstart

# check if service is running
RUNNING=$(docker ps --filter "name=ospd-openvas" --format "{{.Names}}")

if [ "$RUNNING" != "ospd-openvas" ]; then
    echo "ospd-openvas not found, start..."
    docker compose -f $HOME/greenbone-community-container/docker-compose.yml restart ospd-openvas
else
    echo "ospd-openvas is running!"
fi
  1. sudo chmod +x /usr/local/bin/check_ospd.sh
  2. create systemd service file
    sudo nano /etc/systemd/system/check-ospd.service
[Unit]
Description=check ospd-openvas is running
After=network.target docker.service
Requires=docker.service

[Service]
Type=simple
ExecStart=/usr/local/bin/check_ospd.sh

[Install]
WantedBy=multi-user.target
  1. activate service
    sudo systemctl daemon-reexec
    sudo systemctl daemon-reload
    sudo systemctl enable check-ospd.service
  2. start manually
    sudo systemctl start check-ospd.service
  3. check status
    systemctl status check-ospd.service
    systemctl is-active check-ospd.service
  4. check if service starts on boot
    systemctl is-enabled check-ospd.service
  5. check service log
    journalctl -u check-ospd.service --no-pager
  6. start script manually for testing
    sudo /usr/local/bin/check_ospd.sh
1 Like

@ottelo_rbk Please be aware that this thread / topic is about the official Docker community containers (see relevant category this thread is in) so any non-Docker solution won’t work for these. I would suggest to move this hint to a dedicated thread.

This is for the community Docker solution! What makes you think it’s not?

1 Like

Ah, had missed this in the script so all good :+1:

Hi,

have the same problem

fixed - in docker-compose.yml need to change restart :always for ospd-openvas container

2 Likes