diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-proxy/nutcracker/files/nutcracker.initd.2 |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-proxy/nutcracker/files/nutcracker.initd.2')
-rw-r--r-- | net-proxy/nutcracker/files/nutcracker.initd.2 | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/net-proxy/nutcracker/files/nutcracker.initd.2 b/net-proxy/nutcracker/files/nutcracker.initd.2 new file mode 100644 index 000000000000..7e96808f04bb --- /dev/null +++ b/net-proxy/nutcracker/files/nutcracker.initd.2 @@ -0,0 +1,39 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +USER="${USER:-nobody}" +PIDFILE="${PIDFILE:-/var/run/nutcracker.pid}" +NUTCRACKER_BIN="${NUTCRACKER_BIN:-/usr/sbin/nutcracker}" +CONF_FILE="${CONF_FILE:-/etc/nutcracker/nutcracker.yml}" + +depend() { + need net +} + +checkconf() { + ebegin "Testing configuration" + ${NUTCRACKER_BIN} --test-conf \ + --conf-file=${CONF_FILE} \ + >/dev/null 2>&1 + eend $? +} + +start() { + checkconf || exit 1 + ebegin "Starting Nutcracker" + start-stop-daemon --start -u ${USER} \ + --name ${SVCNAME} \ + --exec ${NUTCRACKER_BIN} -- \ + --conf-file="${CONF_FILE}" \ + --pid-file=${PIDFILE} \ + ${NUTCRACKER_OPTS} + eend $? +} + +stop() { + ebegin "Stopping Nutcracker" + start-stop-daemon --stop --pidfile "${PIDFILE}" + eend $? +} + |