Ospd-openvas giving me an error for my systemd build at the end

Hello everyone. I followed the steps on this webpage while only including certain packages that are detailed in the next paragraph. The image I am building is doing everything correct; however, I ran into an issue which I was not before. The error is like so:

Job for ospd-openvas.service failed because the control process exited with error code.
See "systemctl status ospd-openvas.service" and "journalctl -xe" for details.

The libraries I have installed are on Ubuntu 20.04:
gvm_libs: 20.8.0
openvas_scanner: 20.8.0
ospd: 20.8.1
ospd_openvas: 20.8.0

I am new to this and trying to find the logs but do not know where they are for ospd-openvas. Would appreciate any help anyone can give. Thanks!

Hi, if you followed all the steps listed in your provided link, you should find the logs under “/opt/gvm/var/log”
It would be really helpful, if you could add the output from the above mentioned commands to this topic:

  1. systemctl status ospd-openvas.service
  2. journalctl -xe
2 Likes

Here are my logs for systemctl status ospd-openvas.service:

● ospd-openvas.service - Job that runs the ospd-openvas daemon
     Loaded: loaded (/etc/systemd/system/ospd-openvas.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Tue 2021-04-20 13:45:30 UTC; 53s ago
       Docs: man:gvm
    Process: 1920 ExecStart=/opt/gvm/bin/ospd-scanner/bin/python /opt/gvm/bin/ospd-scanner/bin/ospd-openvas --pid-file /opt/gvm/var/run/ospd-openvas.pid --unix-socket=/opt>

Apr 20 13:45:30 ip-172-31-61-14 systemd[1]: ospd-openvas.service: Control process exited, code=exited, status=1/FAILURE
Apr 20 13:45:30 ip-172-31-61-14 systemd[1]: ospd-openvas.service: Failed with result 'exit-code'.
Apr 20 13:45:30 ip-172-31-61-14 systemd[1]: Failed to start Job that runs the ospd-openvas daemon.

Here are my logs for journalctl -xe:

Apr 20 13:41:29 ip-172-31-61-14 python[1862]:     h = klass(*args, **kwargs)
Apr 20 13:41:29 ip-172-31-61-14 python[1862]:   File "/usr/lib/python3.8/logging/__init__.py", line 1143, in __init__
Apr 20 13:41:29 ip-172-31-61-14 python[1862]:     StreamHandler.__init__(self, self._open())
Apr 20 13:41:29 ip-172-31-61-14 python[1862]:   File "/usr/lib/python3.8/logging/__init__.py", line 1172, in _open
Apr 20 13:41:29 ip-172-31-61-14 python[1862]:     return open(self.baseFilename, self.mode, encoding=self.encoding)
Apr 20 13:41:29 ip-172-31-61-14 python[1862]: PermissionError: [Errno 13] Permission denied: '/opt/gvm/var/log/gvm/ospd-scanner.log'
Apr 20 13:41:29 ip-172-31-61-14 systemd[1]: ospd-openvas.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit ospd-openvas.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Apr 20 13:41:29 ip-172-31-61-14 systemd[1]: ospd-openvas.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit ospd-openvas.service has entered the 'failed' state with result 'exit-code'.
Apr 20 13:41:29 ip-172-31-61-14 systemd[1]: Failed to start Job that runs the ospd-openvas daemon.
-- Subject: A start job for unit ospd-openvas.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit ospd-openvas.service has finished with a failure.
--
-- The job identifier is 857 and the job result is failed.

Seems like there is a permissions issue with python that I will have to look into. I did run my script as root so that is probably why it is having problems. I’ll check this out.