diff options
| author | Patrick Lauer <patrick@gentoo.org> | 2016-06-28 10:30:35 +0200 |
|---|---|---|
| committer | Patrick Lauer <patrick@gentoo.org> | 2016-06-28 10:30:35 +0200 |
| commit | 35e7f95e54449356b99a7aceac106e2e4c49eedf (patch) | |
| tree | e0e6287e72347f597dd88798d15a770213f855c6 /net-proxy/nutcracker/files/nutcracker.initd.2 | |
| parent | 143e036505e2b27b1aa5037d52a5f999391b4168 (diff) | |
| download | gentoo-35e7f95e54449356b99a7aceac106e2e4c49eedf.tar.gz gentoo-35e7f95e54449356b99a7aceac106e2e4c49eedf.tar.bz2 gentoo-35e7f95e54449356b99a7aceac106e2e4c49eedf.zip | |
net-proxy/nutcracker: Fix init script
Package-Manager: portage-2.3.0
Diffstat (limited to 'net-proxy/nutcracker/files/nutcracker.initd.2')
| -rw-r--r-- | net-proxy/nutcracker/files/nutcracker.initd.2 | 40 |
1 files changed, 40 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..ee5e3f43577e --- /dev/null +++ b/net-proxy/nutcracker/files/nutcracker.initd.2 @@ -0,0 +1,40 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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 $? +} + |
