Bug#791814: sasl2-bin: fails to start saslauthd
chaouche yacine
yacinechaouche at yahoo.com
Mon Mar 28 18:58:52 UTC 2016
So here's what worked for me. I simply edited /lib/lsb/init-functions.d/40-systemd :
=============================if [ "$_use_systemctl" = "1" ]; then
# Some init scripts use "set -e" and "set -u", we don't want that
# here
set +e
set +u
if [ "x$1" = xstart -o \
"x$1" = xstop -o \
"x$1" = xrestart -o \
"x$1" = xreload -o \
"x$1" = xforce-reload -o \
"x$1" = xstatus ] ; then
systemctl_redirect $0 $1
# Yassine 28/03/2016
# Should this be a return instead ? # exit $?
fi
fi
=============================
This file is sourced from this line in /etc/init.d/saslauthd
=============================. /lib/lsb/init-functions
=============================
and causes that script to be run from systemd instead of normal execution.
========================================================
# Redirect SysV init scripts when executed by the user
if [ $PPID -ne 1 ] && [ -z "${init:-}" ] && [ -z "${_SYSTEMCTL_SKIP_REDIRECT:-}" \
]; then
case $(readlink -f "$0") in
/etc/init.d/*)
_use_systemctl=1
# Some services can't reload through the .service file,
# but can through the init script.
prog=${0##*/}
service="${prog%.sh}.service"
if [ "$(systemctl -p CanReload show $service 2>/dev/null)" = "CanRelo\
ad=no" ] && [ "${1:-}" = "reload" ]; then
_use_systemctl=0
fi
;;
esac
else
export _SYSTEMCTL_SKIP_REDIRECT="true"
fi
========================================================
So if /etc/init.d/ is part of "$0", _use_systemctl will be set to 1, which will cause the previous if test to pass and hijack all the start/stop/status commands AND exit right away.
Yassine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-cyrus-sasl2-debian-devel/attachments/20160328/ec26d26e/attachment-0001.html>
More information about the Pkg-cyrus-sasl2-debian-devel
mailing list