/etc/init.d/etcd is in etcd-server 3.2.17+dfsg-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | #!/bin/sh
### BEGIN INIT INFO
# Provides: etcd
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: etcd daemon
# Description: etcd - highly-available key value store
### END INIT INFO
NAME=$(basename $(readlink -f "$0"))
DAEMON=/usr/bin/$NAME
DAEMON_USER=$NAME
PIDFILE=/var/run/$NAME.pid
DAEMON_ARGS=""
# Exit if executable is not installed
[ -x "$DAEMON" ] || exit 0
set -a
ETCD_NAME="$(hostname)"
ETCD_DATA_DIR="/var/lib/etcd/default"
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
set +a
RETRY=TERM/30/KILL/5
# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS
[ -f /lib/lsb/init-functions ] || exit 1
# Define LSB log_* functions.
. /lib/lsb/init-functions
_ev_ () {
local rv_=$?
[ "$VERBOSE" = "no" ] || eval $@
return $rv_
}
case "$1" in
start)
_ev_ log_action_begin_msg \"Starting $NAME\"
if R=$($0 status); then
_ev_ log_action_end_msg 0 \"$R\"
else
R=$(start-stop-daemon --start --pidfile $PIDFILE --make-pidfile --background \
--chuid $DAEMON_USER --startas /usr/bin/pipexec -- -k \
-- [ D $DAEMON $DAEMON_ARGS ] [ L /usr/bin/logger --tag $NAME ] '{D:1>L:0}' '{D:2>L:0}')
sleep 0.1
$0 status >>/dev/null
_ev_ log_action_end_msg $? \"$R\"
fi
;;
debug)
start-stop-daemon --start --exec $DAEMON --chuid $DAEMON_USER -- $DAEMON_ARGS
;;
stop)
_ev_ log_action_begin_msg \"Stopping $NAME\"
R=$(start-stop-daemon --stop --oknodo --user $DAEMON_USER --pidfile $PIDFILE --remove-pidfile --retry=$RETRY 2>&1)
_ev_ log_action_end_msg $? \"$R\"
;;
status)
## return status 0 if process is running.
status_of_proc -p $PIDFILE "$DAEMON" "$NAME"
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
|