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 | |
parent | games-emulation/dosbox: fix compiling with clang (#449060) (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')
-rw-r--r-- | net-proxy/nutcracker/files/nutcracker.confd.2 | 10 | ||||
-rw-r--r-- | net-proxy/nutcracker/files/nutcracker.initd.2 | 40 |
2 files changed, 50 insertions, 0 deletions
diff --git a/net-proxy/nutcracker/files/nutcracker.confd.2 b/net-proxy/nutcracker/files/nutcracker.confd.2 new file mode 100644 index 000000000000..128c37839a14 --- /dev/null +++ b/net-proxy/nutcracker/files/nutcracker.confd.2 @@ -0,0 +1,10 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +#USER="nobody" +#PIDFILE="/var/run/nutcracker.pid" +#CONF_FILE="/etc/nutcracker/nutcracker.yaml" + +#NUTCRACKER_BIN="/usr/bin/nutcracker" +NUTCRACKER_OPTS="--daemonize" 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 $? +} + |