aboutsummaryrefslogtreecommitdiffstats
path: root/testing/etcd/etcd.initd
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-05-09 08:20:56 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-05-09 08:21:00 +0000
commitd37d8fe99be7e138bfc24144d24200e8e1e9ed3f (patch)
tree17839237cfa68a1caa76df02f917d1741f734878 /testing/etcd/etcd.initd
parent1dc3d131f36dc307adb248f89377a0f585263eb2 (diff)
downloadaports-d37d8fe99be7e138bfc24144d24200e8e1e9ed3f.tar.bz2
aports-d37d8fe99be7e138bfc24144d24200e8e1e9ed3f.tar.xz
testing/etcd: new aport
Diffstat (limited to 'testing/etcd/etcd.initd')
-rw-r--r--testing/etcd/etcd.initd37
1 files changed, 37 insertions, 0 deletions
diff --git a/testing/etcd/etcd.initd b/testing/etcd/etcd.initd
new file mode 100644
index 0000000000..4780434fcb
--- /dev/null
+++ b/testing/etcd/etcd.initd
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+# Copyright 2016 Alpine Linux
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -d -m 0775 -o $USER:$USER $PIDPATH
+ checkpath -d -m 0775 -o $USER:$USER $LOGPATH
+ checkpath -d -m 0775 -o $USER:$USER $ETCD_DATA_DIR
+}
+
+start() {
+ ebegin "Starting $SVCNAME"
+ start-stop-daemon --start \
+ --pidfile "$PIDFILE" \
+ --user $USER \
+ --chdir "$ETCD_DATA_DIR" \
+ --background \
+ --make-pidfile \
+ --exec /usr/bin/etcd -- \
+ -name=$ETCD_NAME \
+ -data-dir="$ETCD_DATA_DIR" \
+ $ETCD_OPTS
+ eend $? "Failed to start $SVCNAME"
+}
+
+stop() {
+ ebegin "Stopping $SVCNAME"
+ start-stop-daemon --stop --pidfile $PIDFILE
+ eend $? "Failed to stop $SVCNAME"
+ rm -f "$PIDFILE"
+}
+