summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2016-06-28 10:30:35 +0200
committerPatrick Lauer <patrick@gentoo.org>2016-06-28 10:30:35 +0200
commit35e7f95e54449356b99a7aceac106e2e4c49eedf (patch)
treee0e6287e72347f597dd88798d15a770213f855c6 /net-proxy
parentgames-emulation/dosbox: fix compiling with clang (#449060) (diff)
downloadgentoo-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')
-rw-r--r--net-proxy/nutcracker/files/nutcracker.confd.210
-rw-r--r--net-proxy/nutcracker/files/nutcracker.initd.240
-rw-r--r--net-proxy/nutcracker/nutcracker-0.4.1-r1.ebuild (renamed from net-proxy/nutcracker/nutcracker-0.4.1.ebuild)4
3 files changed, 52 insertions, 2 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 $?
+}
+
diff --git a/net-proxy/nutcracker/nutcracker-0.4.1.ebuild b/net-proxy/nutcracker/nutcracker-0.4.1-r1.ebuild
index f97f42cfef33..aec29cf38fa5 100644
--- a/net-proxy/nutcracker/nutcracker-0.4.1.ebuild
+++ b/net-proxy/nutcracker/nutcracker-0.4.1-r1.ebuild
@@ -37,8 +37,8 @@ src_install() {
insinto /etc/nutcracker
newins conf/nutcracker.yml nutcracker.yml.example
- newconfd "${FILESDIR}/nutcracker.confd" nutcracker
- newinitd "${FILESDIR}/nutcracker.initd" nutcracker
+ newconfd "${FILESDIR}/nutcracker.confd.2" nutcracker
+ newinitd "${FILESDIR}/nutcracker.initd.2" nutcracker
if use doc; then
dodoc -r notes