summaryrefslogtreecommitdiff
blob: 8af378b20fd6a72ee9ef70828148604af00f699f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/sbin/openrc-run
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

: ${GVM_USER:=gvm}
: ${GVM_GROUP:=$(id -ng ${GVM_USER})}
: ${NOTUS_TIMEOUT:=30}

name="Greenbone Notus Scanner"
command=/usr/bin/notus-scanner
command_user="${GVM_USER}:${GVM_GROUP}"
pidfile="/run/notus-scanner/${RC_SVCNAME}.pid"
configfile="/etc/gvm/notus-scanner.toml"
command_args="--pid-file ${pidfile} \
	--config ${configfile}"
retry="${NOTUS_TIMEOUT}"

depend() {
	after bootmisc
	need localmount mosquitto
}

start_pre() {
        checkpath -d --owner ${GVM_USER} /run/notus-scanner
}

start_post() {
	ewaitfile 10 ${pidfile}
	checkpath -d --owner root:root /run/notus-scanner
	checkpath -f --owner root:root ${pidfile}
}