aports/testing/etcd/etcd.initd
Gareth Williams 8a89854d9f testing/etcd: fix inability to read config options
Fixes #7161

Options in /etc/conf.d/etcd aren't passed to the daemon.  This patch
configures etcd to read options from a YAML file instead.
2019-03-06 12:48:09 +00:00

37 lines
766 B
Plaintext

#!/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 -- \
--config-file=$ETCD_CONFIG \
--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"
}