Gvm-checking not found

Hello!

I have been building the current gvm-libs, gvmd, ospd-openvas, openvas-scanner, heimdal, openvas-smb via source inside a ubi8-minimal docker container. I generally have been following this guide here: Full GVM-11 Build Guide for CentOS 8 and have installing at this /opt/gvm/ directory.

The build goes through fine however, I think I am having issues with gvmd. Here is the log file

# /opt/gvm/var/log/gvm/gvmd.log
md   main:MESSAGE:2022-11-21 17h14.46 utc:177:    Greenbone Vulnerability Manager version 22.4.0~dev1 (DB revision 250)
md manage:WARNING:2022-11-21 17h14.46 utc:177: Failed to open lock file '/opt/gvm/run/gvmd/gvm-checking': No such file or directory
md   main:CRITICAL:2022-11-21 17h14.46 utc:177: gvmd: Error trying to get checking lock

I believe my issue may be related to: Gvmd.service: Can't open PID file /opt/gvm/var/run/gvmd/gvmd.pid (yet?) after start: Operation not permitted

I have tried searching for the gvm-checking file and it is nowhere to be found. What can I do to resolve this?

FYI, this is how i’m building everything

    GVM_LIBS_VERSION='v22.4.0' \
    GVMD_VERSION='v22.4.0' \
    OPENVAS_VERSION='v22.4.0' \
    OPENVAS_SMB_VERSION='v22.4.0' \
    OSPD_OPENVAS_VERSION='v22.4.2' \
    HEIMDAL_VERSION='7.7.0' \


# ospd-openvas
    curl -o ospd-openvas.tar.gz -sL https://github.com/greenbone/ospd-openvas/archive/refs/tags/${OSPD_OPENVAS_VERSION}.tar.gz && \
    tar -xf ospd-openvas.tar.gz && \
    cd ospd-openvas-* && \
    pip3 install --prefix=/opt/gvm . && \

# gvm-libs
    curl -o gvm-libs.tar.gz -sL https://github.com/greenbone/gvm-libs/archive/refs/tags/${GVM_LIBS_VERSION}.tar.gz && \
    tar -xf gvm-libs.tar.gz && \
    cd gvm-libs-* && \
    mkdir build && \
    cd build && \
    cmake .. -DCMAKE_INSTALL_PREFIX=/opt/gvm -DCMAKE_BUILD_TYPE=Release \
        -DSYSCONFDIR=/opt/gvm/etc \
        -DLOCALSTATEDIR=/opt/gvm/var && \
    make -j$(nproc) && \
    make install 

# heimdal
    wget https://github.com/heimdal/heimdal/releases/download/heimdal-${HEIMDAL_VERSION}/heimdal-${HEIMDAL_VERSION}.tar.gz && \
    tar xzf heimdal-${HEIMDAL_VERSION}.tar.gz && \
    cd heimdal-*/ && \
    ./configure --enable-opt=no --disable-otp --prefix=/opt/heimdal && \
    make -j$(nproc) && \
    make install && \
    ln -s /opt/heimdal/include/ /opt/heimdal/include/heimdal && \
    echo "/opt/heimdal/lib" > /etc/ld.so.conf.d/heimdal-gssapi.conf && \
    ldconfig

# openvas-smb
    ln -fs /usr/lib64/libtspi.so.1 /usr/lib64/libtspi.so && \
    curl -o openvas-smb.tar.gz -sL https://github.com/greenbone/openvas-smb/archive/refs/tags/${OPENVAS_SMB_VERSION}.tar.gz && \
    tar -xf openvas-smb.tar.gz && \
    cd openvas-smb-* && \
    mkdir build && \
    cd build && \
    cmake .. -DCMAKE_INSTALL_PREFIX=/opt/gvm -DCMAKE_BUILD_TYPE=Release && \
    make -j$(nproc) && \
    make install 

# openvas-scanner
    curl -o openvas.tar.gz -sL https://github.com/greenbone/openvas-scanner/archive/refs/tags/${OPENVAS_SCANNER_VERSION}.tar.gz && \
    tar -xf openvas.tar.gz && \
    cd openvas-* && \
    mkdir build && \
    cd build && \
    cmake .. -DCMAKE_INSTALL_PREFIX=/opt/gvm -DCMAKE_BUILD_TYPE=Release \
        -DOPENVAS_FEED_LOCK_PATH=/opt/gvm/var/run/feed-update.lock \
        -DOPENVAS_RUN_DIR=/opt/gvm/var/run/ospd \
        -DSYSCONFDIR=/opt/gvm/etc \
        -DLOCALSTATEDIR=/opt/gvm/var && \
    make -j$(nproc) && \
    make install 

# gvmd
    curl -o gvmd.tar.gz -sL https://github.com/greenbone/gvmd/archive/refs/tags/${GVMD_VERSION}.tar.gz && \
    tar -xf gvmd.tar.gz && \
    ln -s /usr/include /usr/include/postgresql && \
    cd gvmd-* && \
    mkdir build && \
    cd build && \
    mkdir -p /usr/include/postgresql && \
    cmake .. -DCMAKE_INSTALL_PREFIX=/opt/gvm -DCMAKE_BUILD_TYPE=Release \
        -DSYSCONFDIR=/opt/gvm/etc \
        -DLOCALSTATEDIR=/opt/gvm/var \
        -DGVM_DATA_DIR=/opt/gvm/share/gvm/ \
        -DGVMD_RUN_DIR=/opt/gvm/run/gvmd \
        -DOPENVAS_DEFAULT_SOCKET=/opt/gvm/run/ospd/ospd-openvas.sock \
        -DGVM_FEED_LOCK_PATH=/opt/gvm/var/run/feed-update.lock \
        -DSYSTEMD_SERVICE_DIR=/lib/systemd/system \
        -DLOGROTATE_DIR=/etc/logrotate.d && \
    make -j$(nproc) && \
    make install && \
    rm -rf ${SRC_PATH}/gvmd-* && \
    gvmd --version && \
    rm -f /usr/include/postgresql/libpq-fe.h && rm -rf /usr/include/postgresql 

As I said the build goes through OK and I’m able to see these:

[root@25c14b1bddbb gvm]# gvmd --version
Greenbone Vulnerability Manager 22.4.0~dev1
Manager DB revision 250
Copyright (C) 2009-2021 Greenbone Networks GmbH
License: AGPL-3.0-or-later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[root@25c14b1bddbb gvm]# openvas --version
OpenVAS 22.4.0
gvm-libs 22.4.0
Most new code since 2005: (C) 2022 Greenbone Networks GmbH
Nessus origin: (C) 2004 Renaud Deraison <deraison@nessus.org>
License GPLv2: GNU GPL version 2
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Although I keep this during the build. It doesn’t get stopped btw.

/opt/gvm/sbin/greenbone-feed-sync: line 600: /opt/gvm/var/run/feed-update.lock: No such file or directory

Looks like the installation of pg-gvm (https://github.com/greenbone/pg-gvm) could be missing. I would suggest to follow the instruction from https://greenbone.github.io which includes setup instructions for pg-gvm.

Hey thanks for the reply. I tried building pg-gvm but am getting this error:

Not sure why because I have postgresql-server, postgresql-contrib, postgresql-server-devel installed.

I have tried building in ubi8/centos8 ubi9/centos9-stream but same result.

@cfi any ideas?

just tested on version gvmd version 21.4.4 and 21.4.5. Both of them report of missing gvm-checking

Could you follow our own build from source guide at https://greenbone.github.io/docs/latest/22.4/source-build/index.html it also contains instructions for CentOS 9. The error for gvm-checking is very likely because the /run/gvmd directory doesn’t exists or hasn’t write permissions for the user of gvmd.

2 Likes

@bricks I have followed the instructions and made it very far for version 22. However, I’ve come across the same problem.

Hi, this seems to be an issue with systemd. Either the /run/gvmd directory is not created or the permissions are incorrect. Can you try creating the directory manually sudo -u gvm mkdir -p /run/gvmd and afterwards start the gvmd service?

2 Likes

Thank you, creating the directory solved the issue. Can’t believe it was this simple.

1 Like