aboutsummaryrefslogtreecommitdiffstats
path: root/testing/openvas-scanner/openvassd.initd
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-04-20 09:11:28 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-04-20 09:11:28 +0000
commitc6225fb3c5fc65bd8ba94dc561f8dd3100a10b9f (patch)
tree063a159992a3198b1a8d42ae2479d7ed70bc8cd0 /testing/openvas-scanner/openvassd.initd
parent26860ec8e1fe9d863c49c9b996e891d74523eb0b (diff)
testing/openvas-scanner: updated init,confd, config files and added daily script for nvt sync
Diffstat (limited to 'testing/openvas-scanner/openvassd.initd')
-rw-r--r--testing/openvas-scanner/openvassd.initd43
1 files changed, 16 insertions, 27 deletions
diff --git a/testing/openvas-scanner/openvassd.initd b/testing/openvas-scanner/openvassd.initd
index 560141d74f8..4b4de5e515b 100644
--- a/testing/openvas-scanner/openvassd.initd
+++ b/testing/openvas-scanner/openvassd.initd
@@ -1,37 +1,26 @@
#!/sbin/openrc-run
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header:
+# $Id$
-depend() {
- need net
-}
+name="OpenVAS Scanner"
+command="/usr/bin/openvassd"
+command_args="${SCANNER_LISTEN} ${SCANNER_PORT} ${SCANNER_SRCIP} ${SCANNER_EXTRA_ARGS}"
+pidfile="/run/openvassd.pid"
+extra_stopped_commands="create_cache"
-sanity_test() {
- if [ -z "${OPENVAS_USER}" ] ; then
- eerror "OPENVAS_USER is empty"
- return 1
- fi
- if [ $OPENVAS_USER != 'root' ] ; then
- chown -R $OPENVAS_USER:$OPENVAS_GROUP /var/cache/openvas/ /var/lib/openvas/ /var/log/openvas/
- chgrp -R $OPENVAS_USER /etc/openvas/ /var/lib/openvas/ /usr/share/openvas/openvasmd/global_report_formats/
- chmod -R g+rX /etc/openvas/ /var/lib/openvas/
- fi
+depend() {
+ after bootmisc
+ need localmount net
}
-start() {
- ebegin "Starting openvassd (scanner) as user ${OPENVAS_USER}"
- sanity_test || return 1
- #for using sbin tools when running as non root
- export PATH="$PATH:/sbin:/usr/sbin"
- start-stop-daemon --start --name openvassd --user "${OPENVAS_USER}" --exec /usr/bin/openvassd \
- --pidfile /var/run/openvassd.pid
- eend $?
+start_pre() {
+ checkpath --directory --mode 0775 --quiet /var/cache/openvas
}
-stop() {
- ebegin "Stop openvassd (scanner)"
- start-stop-daemon --stop --name openvassd \
- --pidfile /var/run/openvassd.pid
+create_cache() {
+ checkpath --directory --mode 0775 --quiet /var/cache/openvas
+ ebegin "Generating initial Cache"
+ /usr/bin/openvassd --foreground --only-cache
eend $?
}