[pkg-go] Bug#821012: etcd: Incorrect use of readlink in sysvinit script
Niall Donegan
niall at moybella.net
Thu Apr 14 15:13:56 UTC 2016
Package: etcd
Version: 2.2.5+dfsg-1
Severity: important
Tags: newcomer
Dear Maintainer,
The copy of sysvinit script in the etc package tries to get the name of the package using:
NAME=$(basename $(readlink $0))
Unfortunately, this fails due to the incorrect invocation of readlink. This should most likely read:
NAME=$(basename $(readlink -f $0))
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages etcd depends on:
ii adduser 3.114
ii init-system-helpers 1.29
ii libc6 2.22-5
ii pipexec 2.5.4-1
etcd recommends no packages.
etcd suggests no packages.
-- Configuration Files:
/etc/init.d/etcd changed:
NAME=$(basename $(readlink -f $0))
DAEMON=/usr/bin/$NAME
DAEMON_USER=$NAME
PIDFILE=/var/run/$NAME.pid
DAEMON_ARGS=""
[ -x "$DAEMON" ] || exit 0
set -a
ETCD_NAME="$(hostname)"
ETCD_DATA_DIR="/var/lib/etcd/default"
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
set +a
RETRY=TERM/30/KILL/5
[ -f /etc/default/rcS ] && . /etc/default/rcS
[ -f /lib/lsb/init-functions ] || exit 1
. /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
-- no debconf information
More information about the Pkg-go-maintainers
mailing list