net-analyzer/gvmd: fix LICENSE, gvm-sync-all helper, GVM_DEFAULT_DROP_USER

Signed-off-by: Florian Schmaus <flow@gentoo.org>
This commit is contained in:
Florian Schmaus
2022-05-09 13:50:33 +02:00
parent 5589f7f841
commit 123dc0e869
4 changed files with 52 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
case ${USER} in
root)
exec su --shell /bin/bash --command "$0 $@" gvm
;;
gvm)
;;
*)
>&2 echo "Must be run as root or gvm user not ${USER}"
exit 1
;;
esac
while getopts d OPTION "$@"; do
case ${OPTION} in
d)
set -x
;;
esac
done
shift $((OPTIND - 1))
greenbone-nvt-sync
# Note that Greenbone recommends to sync CERT *after* SCAP, as the
# former depends on the later. See
# https://github.com/greenbone/gvmd/blob/main/INSTALL.md#keeping-the-feeds-up-to-date
for FEED_TYPE in SCAP CERT GVMD_DATA; do
greenbone-feed-sync --type ${FEED_TYPE}
done

View File

@@ -0,0 +1,7 @@
[Unit]
Description=Update all feeds of the Greenbone Vulerability Management (GMV) suite
After=network-online.target
[Service]
ExecStart=/usr/sbin/gvm-sync-all
User=gvm

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Daily update of all feeds of the Greenbone Vulerability Management (GMV) suite
[Timer]
OnCalendar=daily
RandomizedDelaySec=2hour
[Install]
WantedBy=timers.target

View File

@@ -10,7 +10,7 @@ HOMEPAGE="https://www.greenbone.net https://github.com/greenbone/gvmd/"
SRC_URI="https://github.com/greenbone/gvmd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
SLOT="0"
LICENSE="GPL-2+"
LICENSE="AGPL-3+"
KEYWORDS="~amd64 ~x86"
IUSE="doc test"
RESTRICT="!test? ( test )"
@@ -87,6 +87,7 @@ src_configure() {
"-DLIBDIR=${EPREFIX}/usr/$(get_libdir)"
"-DSBINDIR=${EPREFIX}/usr/bin"
"-DSYSTEMD_SERVICE_DIR=$(systemd_get_systemunitdir)"
"-DGVM_DEFAULT_DROP_USER=gvm"
)
cmake_src_configure
}
@@ -123,4 +124,7 @@ src_install() {
if ! use prefix; then
fowners -R gvm:gvm /var/lib/gvm
fi
dosbin "${FILESDIR}"/gvm-sync-all
systemd_dounit "${FILESDIR}"/gvm-sync-all.{service,timer}
}