diff options
| author | Yagnesh Mistry <ysh@live.in> | 2015-10-22 01:32:34 +0530 |
|---|---|---|
| committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-11-04 09:48:58 +0000 |
| commit | 14113e0aa36b56f220344b668d9e49ac13627455 (patch) | |
| tree | 0509053c9f71cbbd92119ca874e8e88deaaab91f /testing/twemproxy/nutcracker.initd | |
| parent | b87e908ccb951a69a50e22b433816a01f6ba0ee4 (diff) | |
| download | aports-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.initd | 42 |
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 $? +} + + |
