Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust cmake args to get new paths working again #10

Merged
merged 2 commits into from
Aug 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ function install_gvm_libs() {
mkdir -p build
cd build
rm -rf *
cmake -DCMAKE_INSTALL_PREFIX="$GVM_INSTALL_PREFIX" ..
cmake -DCMAKE_INSTALL_PREFIX="$GVM_INSTALL_PREFIX" \
-DLOCALSTATEDIR="$GVM_INSTALL_PREFIX/var" -DSYSCONFDIR="$GVM_INSTALL_PREFIX/etc" ..
make -j$(nproc)
make doc
make install
Expand All @@ -263,12 +264,15 @@ function install_openvas() {
mkdir -p build
cd build
rm -rf *
cmake -DCMAKE_INSTALL_PREFIX="$GVM_INSTALL_PREFIX" ..
cmake -DCMAKE_INSTALL_PREFIX="$GVM_INSTALL_PREFIX" \
-DLOCALSTATEDIR="$GVM_INSTALL_PREFIX/var" -DSYSCONFDIR="$GVM_INSTALL_PREFIX/etc" ..
make -j$(nproc)
make doc
make install
}

$AS_ROOT "mkdir -p -m 750 /run/gvm /run/ospd"
$AS_ROOT "chown -R gvm. /run/gvm /run/ospd"
log -i "Install gvm-libs"
exec_as gvm install_gvm_libs PKG_CONFIG_PATH GVM_INSTALL_PREFIX
log -i "Install openvas-smb"
Expand Down Expand Up @@ -310,7 +314,8 @@ function install_gvmd() {
mkdir -p build
cd build
rm -rf *
cmake -DCMAKE_INSTALL_PREFIX="$GVM_INSTALL_PREFIX" -DSYSTEMD_SERVICE_DIR="$GVM_INSTALL_PREFIX" ..
cmake -DCMAKE_INSTALL_PREFIX="$GVM_INSTALL_PREFIX" -DSYSTEMD_SERVICE_DIR="$GVM_INSTALL_PREFIX" \
-DLOCALSTATEDIR="$GVM_INSTALL_PREFIX/var" -DSYSCONFDIR="$GVM_INSTALL_PREFIX/etc" ..
make -j$(nproc)
make doc
make install
Expand Down Expand Up @@ -358,7 +363,8 @@ function install_gsa() {
mkdir -p build
cd build
rm -rf *
cmake -DCMAKE_INSTALL_PREFIX="$GVM_INSTALL_PREFIX" -DSYSTEMD_SERVICE_DIR="$GVM_INSTALL_PREFIX" ..
cmake -DCMAKE_INSTALL_PREFIX="$GVM_INSTALL_PREFIX" -DSYSTEMD_SERVICE_DIR="$GVM_INSTALL_PREFIX" \
-DLOCALSTATEDIR="$GVM_INSTALL_PREFIX/var" -DSYSCONFDIR="$GVM_INSTALL_PREFIX/etc" ..
make -j$(nproc)
make doc
make install
Expand All @@ -376,7 +382,7 @@ function install_ospd_openvas() {
virtualenv --python python3 "$GVM_INSTALL_PREFIX/bin/ospd-scanner/"
fi
. "$GVM_INSTALL_PREFIX/bin/ospd-scanner/bin/activate"
mkdir -p "$GVM_INSTALL_PREFIX/var/run/ospd/"
python3 -m pip install --upgrade pip
cd ospd
pip3 install .
cd ../ospd-openvas/
Expand All @@ -398,9 +404,9 @@ After=postgresql.service ospd-openvas.service
Type=forking
User=gvm
Group=gvm
PIDFile=$GVM_INSTALL_PREFIX/var/run/gvmd.pid
PIDFile=/run/gvm/gvmd.pid
WorkingDirectory=$GVM_INSTALL_PREFIX
ExecStart=$GVM_INSTALL_PREFIX/sbin/gvmd --osp-vt-update=$GVM_INSTALL_PREFIX/var/run/ospd.sock -c $GVM_INSTALL_PREFIX/var/run/gvmd.sock
ExecStart=$GVM_INSTALL_PREFIX/sbin/gvmd --osp-vt-update=/run/ospd/ospd.sock -c /run/gvm/gvmd.sock
ExecReload=/bin/kill -HUP \$MAINPID
KillMode=mixed
Restart=on-failure
Expand All @@ -427,9 +433,9 @@ After=network.target
Wants=gvmd.service
[Service]
Type=forking
PIDFile=$GVM_INSTALL_PREFIX/var/run/gsad.pid
PIDFile=/run/gvm/gsad.pid
WorkingDirectory=$GVM_INSTALL_PREFIX
ExecStart=$GVM_INSTALL_PREFIX/sbin/gsad --drop-privileges=gvm --munix-socket=$GVM_INSTALL_PREFIX/var/run/gvmd.sock $GVM_GSAD_OPTS
ExecStart=$GVM_INSTALL_PREFIX/sbin/gsad --drop-privileges=gvm --munix-socket=/run/gvm/gvmd.sock $GVM_GSAD_OPTS
Restart=on-failure
RestartSec=2min
KillMode=process
Expand Down Expand Up @@ -458,8 +464,8 @@ Type=forking
User=gvm
Group=gvm
WorkingDirectory=$GVM_INSTALL_PREFIX
PIDFile=$GVM_INSTALL_PREFIX/var/run/ospd-openvas.pid
ExecStart=$GVM_INSTALL_PREFIX/bin/ospd-scanner/bin/python $GVM_INSTALL_PREFIX/bin/ospd-scanner/bin/ospd-openvas --pid-file $GVM_INSTALL_PREFIX/var/run/ospd-openvas.pid --unix-socket=$GVM_INSTALL_PREFIX/var/run/ospd.sock --log-file $GVM_INSTALL_PREFIX/var/log/gvm/ospd-scanner.log --lock-file-dir $GVM_INSTALL_PREFIX/var/run/ospd/
PIDFile=/run/ospd/ospd-openvas.pid
ExecStart=$GVM_INSTALL_PREFIX/bin/ospd-scanner/bin/python $GVM_INSTALL_PREFIX/bin/ospd-scanner/bin/ospd-openvas --pid-file /run/ospd/ospd-openvas.pid --unix-socket=/run/ospd/ospd.sock --log-file $GVM_INSTALL_PREFIX/var/log/gvm/ospd-scanner.log --lock-file-dir /run/ospd/
Restart=on-failure
RestartSec=2min
KillMode=process
Expand All @@ -483,7 +489,7 @@ function set_default_scanner() {
set -e
. /etc/profile.d/gvm.sh
local id="$(gvmd --get-scanners | grep -i openvas | cut -d ' ' -f1 | tr -d '\n')"
gvmd --modify-scanner="$id" --scanner-host="$GVM_INSTALL_PREFIX/var/run/ospd.sock"
gvmd --modify-scanner="$id" --scanner-host="/run/ospd/ospd.sock"
}

log -i "Set OpenVAS default scanner"
Expand Down