diff options
author | Francesco Colista <fcolista@alpinelinux.org> | 2015-11-30 14:13:44 +0000 |
---|---|---|
committer | Francesco Colista <fcolista@alpinelinux.org> | 2015-11-30 14:13:44 +0000 |
commit | 23ea12524fbace868f5843a3dd4eac1240859512 (patch) | |
tree | b5859987b946751a47294f849b1f6cf7f4c04e43 /testing/openvas-scanner/openvassd.initd | |
parent | 893015934bd03e0035d8681a05f455a9623395d2 (diff) | |
download | aports-23ea12524fbace868f5843a3dd4eac1240859512.tar.bz2 aports-23ea12524fbace868f5843a3dd4eac1240859512.tar.xz |
testign/openvas-scanner: new aport
Diffstat (limited to 'testing/openvas-scanner/openvassd.initd')
-rw-r--r-- | testing/openvas-scanner/openvassd.initd | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/testing/openvas-scanner/openvassd.initd b/testing/openvas-scanner/openvassd.initd new file mode 100644 index 0000000000..560141d74f --- /dev/null +++ b/testing/openvas-scanner/openvassd.initd @@ -0,0 +1,37 @@ +#!/sbin/openrc-run +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: + +depend() { + need net +} + +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 +} + +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 $? +} + +stop() { + ebegin "Stop openvassd (scanner)" + start-stop-daemon --stop --name openvassd \ + --pidfile /var/run/openvassd.pid + eend $? +} |