aboutsummaryrefslogtreecommitdiff
path: root/network/etcd/rc.etcd
diff options
context:
space:
mode:
authorThibaut Notteboom <thibaut.notteboom@gmail.com>2018-07-23 22:12:25 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-07-28 08:51:47 +0700
commit819088b4aaf1d84bfde15597aaff6870505534af (patch)
tree25d3fba75203c033574a7e56490457a2006d073e /network/etcd/rc.etcd
parenta89d29f0f8bd2f8d7c12a3a77146a00f0f677f3d (diff)
network/etcd: Added (key value store for shared configuration).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'network/etcd/rc.etcd')
-rw-r--r--network/etcd/rc.etcd37
1 files changed, 37 insertions, 0 deletions
diff --git a/network/etcd/rc.etcd b/network/etcd/rc.etcd
new file mode 100644
index 0000000000000..abd95ede0205f
--- /dev/null
+++ b/network/etcd/rc.etcd
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+ETCD_USER=etcd
+ETCD_BIN=/usr/bin/etcd
+ETCD_LOG_FILE=/var/log/etcd/etcd.log
+ETCD_CONFIG_FILE=/etc/etcd/etcd.conf.yml
+
+etcd_start() {
+ echo "Starting the etcd service: $ETCD_BIN"
+ su - $ETCD_USER -c "$ETCD_BIN --config-file $ETCD_CONFIG_FILE >> $ETCD_LOG_FILE 2>&1 &"
+}
+
+etcd_stop() {
+ echo "Stoping the etcd service: $ETCD_BIN"
+ killall etcd
+}
+
+etcd_restart() {
+ etcd_stop
+ sleep 1
+ etcd_start
+}
+
+case "$1" in
+ 'start')
+ etcd_start
+ ;;
+ 'stop')
+ etcd_stop
+ ;;
+ 'restart')
+ etcd_restart
+ ;;
+ *)
+ echo "Usage: $0 start|stop|restart"
+ ;;
+esac