greenbone-nvt-sync should run every time it is executed without any problem
Actual behavior
When greenbone-nvt-sync is executed and fails (e.g. due to a connection problem), the .lock file isn't removed and prevents the greenbone-nvt-sync from executing normally the next time.
Instead the following error message is dropped:
<28>Jun 10 16:29:35 greenbone-nvt-sync: Another process related to the feed update is already running.
But there is no process running.
Deleting the /opt/gvm/var/run/feed-update.lock manually seems to be a workaround.
### Steps to reproduce
initial situation:
gvm@7cdfbd15f3eb:~$ ls /opt/gvm/var/run/feed-update.lock
ls: cannot access '/opt/gvm/var/run/feed-update.lock': No such file or directory
gvm@7cdfbd15f3eb:~$ greenbone-nvt-sync
<28>Jun 10 16:29:17 greenbone-nvt-sync: The log facility is not working as expected. All messages will be written to the standard error stream.
<29>Jun 10 16:29:17 greenbone-nvt-sync: No Greenbone Security Feed access key found, falling back to Greenbone Community Feed
<29>Jun 10 16:29:17 greenbone-nvt-sync: Configured NVT rsync feed: rsync://feed.community.greenbone.net:/nvt-feed
rsync: failed to connect to feed.community.greenbone.net (45.135.106.142): Connection refused (111)
rsync: failed to connect to feed.community.greenbone.net (2a0e:6b40:20:106:20c:29ff:fe67:cbb5): Network is unreachable (101)
rsync error: error in socket IO (code 10) at clientserver.c(125) [Receiver=3.1.2]
<27>Jun 10 16:29:17 greenbone-nvt-sync: rsync failed.
problem:
gvm@7cdfbd15f3eb:~$ ls /opt/gvm/var/run/feed-update.lock
/opt/gvm/var/run/feed-update.lock
gvm@7cdfbd15f3eb:~$ greenbone-nvt-sync
<28>Jun 10 16:29:35 greenbone-nvt-sync: The log facility is not working as expected. All messages will be written to the standard error stream.
<28>Jun 10 16:29:35 greenbone-nvt-sync: Another process related to the feed update is already running.
### GVM versions
**gsa:** Greenbone Security Assistant 9.0.1~git-f4a4658fb-gsa-9.0
**gvm:** Greenbone Vulnerability Manager 9.0.1~git-5a976c58-gvmd-9.0
**openvas:** OpenVAS 7.0.1
**gvm-libs:** gvm-libs 11.0.1
**openvas-smb:**
**ospd-openvas:** OSP Server for openvas: 1.0.1
OSP: 1.2
OSPd: 2.0.1
### Environment
**Operating system:**
Docker Container
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
**Installation method / source:** (packages, source installation)
### Logfiles
```
```
Expected behavior
greenbone-nvt-sync should run every time it is executed without any problem
Actual behavior
When greenbone-nvt-sync is executed and fails (e.g. due to a connection problem), the .lock file isn't removed and prevents the greenbone-nvt-sync from executing normally the next time.
Instead the following error message is dropped:
<28>Jun 10 16:29:35 greenbone-nvt-sync: Another process related to the feed update is already running. But there is no process running. Deleting the /opt/gvm/var/run/feed-update.lock manually seems to be a workaround. ### Steps to reproduce initial situation: gvm@7cdfbd15f3eb:~$ ls /opt/gvm/var/run/feed-update.lock ls: cannot access '/opt/gvm/var/run/feed-update.lock': No such file or directory gvm@7cdfbd15f3eb:~$ greenbone-nvt-sync <28>Jun 10 16:29:17 greenbone-nvt-sync: The log facility is not working as expected. All messages will be written to the standard error stream. <29>Jun 10 16:29:17 greenbone-nvt-sync: No Greenbone Security Feed access key found, falling back to Greenbone Community Feed <29>Jun 10 16:29:17 greenbone-nvt-sync: Configured NVT rsync feed: rsync://feed.community.greenbone.net:/nvt-feed rsync: failed to connect to feed.community.greenbone.net (45.135.106.142): Connection refused (111) rsync: failed to connect to feed.community.greenbone.net (2a0e:6b40:20:106:20c:29ff:fe67:cbb5): Network is unreachable (101) rsync error: error in socket IO (code 10) at clientserver.c(125) [Receiver=3.1.2] <27>Jun 10 16:29:17 greenbone-nvt-sync: rsync failed. problem: gvm@7cdfbd15f3eb:~$ ls /opt/gvm/var/run/feed-update.lock /opt/gvm/var/run/feed-update.lock gvm@7cdfbd15f3eb:~$ greenbone-nvt-sync <28>Jun 10 16:29:35 greenbone-nvt-sync: The log facility is not working as expected. All messages will be written to the standard error stream. <28>Jun 10 16:29:35 greenbone-nvt-sync: Another process related to the feed update is already running. ### GVM versions **gsa:** Greenbone Security Assistant 9.0.1~git-f4a4658fb-gsa-9.0 **gvm:** Greenbone Vulnerability Manager 9.0.1~git-5a976c58-gvmd-9.0 **openvas:** OpenVAS 7.0.1 **gvm-libs:** gvm-libs 11.0.1 **openvas-smb:** **ospd-openvas:** OSP Server for openvas: 1.0.1 OSP: 1.2 OSPd: 2.0.1 ### Environment **Operating system:** Docker Container DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS" **Installation method / source:** (packages, source installation) ### Logfiles ``` ```