aboutsummaryrefslogtreecommitdiffstats
path: root/testing/twemproxy/nutcracker.initd
diff options
context:
space:
mode:
authorYagnesh Mistry <ysh@live.in>2015-10-22 01:32:34 +0530
committerNatanael Copa <ncopa@alpinelinux.org>2015-11-04 09:48:58 +0000
commit14113e0aa36b56f220344b668d9e49ac13627455 (patch)
tree0509053c9f71cbbd92119ca874e8e88deaaab91f /testing/twemproxy/nutcracker.initd
parentb87e908ccb951a69a50e22b433816a01f6ba0ee4 (diff)
downloadaports-14113e0aa36b56f220344b668d9e49ac13627455.tar.bz2
aports-14113e0aa36b56f220344b668d9e49ac13627455.tar.xz
testing/twemproxy: new aport
https://github.com/twitter/twemproxy A fast, light-weight proxy for memcached and redis
Diffstat (limited to 'testing/twemproxy/nutcracker.initd')
-rw-r--r--testing/twemproxy/nutcracker.initd42
1 files changed, 42 insertions, 0 deletions
diff --git a/testing/twemproxy/nutcracker.initd b/testing/twemproxy/nutcracker.initd
new file mode 100644
index 0000000000..76d120a779
--- /dev/null
+++ b/testing/twemproxy/nutcracker.initd
@@ -0,0 +1,42 @@
+#!/sbin/openrc-run
+
+NAME="nutcracker"
+DAEMON=/usr/sbin/nutcracker
+USER="${USER:-nobody}"
+CONFFILE="${CONFFILE:-/etc/nutcracker/nutcracker.yml}"
+
+DAEMON_ARGS=${DAEMON_ARGS:-"-c $CONFFILE -o $LOGFILE -p $PIDFILE -d"}
+
+depend() {
+ need net
+ after firewall
+}
+
+checkconf() {
+ ebegin "Testing configuration: "
+ ${DAEMON} --test-conf \
+ --conf-file=${CONFFILE} \
+ >/dev/null 2>&1
+ eend $?
+}
+
+
+start() {
+ checkconf || exit 1
+ ebegin "Starting ${NAME}: "
+ start-stop-daemon --start --quiet \
+ --pidfile ${PIDFILE} \
+ --chuid ${USER}:${USER} \
+ --exec ${DAEMON} -- ${DAEMON_ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${NAME}: "
+ start-stop-daemon --stop --quiet \
+ --pidfile ${PIDFILE} \
+ --exec ${DAEMON}
+ eend $?
+}
+
+