mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
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:
31
net-analyzer/gvmd/files/gvm-sync-all
Normal file
31
net-analyzer/gvmd/files/gvm-sync-all
Normal 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
|
||||
7
net-analyzer/gvmd/files/gvm-sync-all.service
Normal file
7
net-analyzer/gvmd/files/gvm-sync-all.service
Normal 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
|
||||
9
net-analyzer/gvmd/files/gvm-sync-all.timer
Normal file
9
net-analyzer/gvmd/files/gvm-sync-all.timer
Normal 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
|
||||
@@ -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}
|
||||
}
|
||||
Reference in New Issue
Block a user