Commit 44b765a9 authored by Tollef Fog Heen's avatar Tollef Fog Heen
Browse files

Divert lsb init-functions instead of abusing logging hook

parent 91d02107
......@@ -7,6 +7,9 @@ systemd (25-1) experimental; urgency=low
* Add Conflicts on klogd, since it doesn't work correctly with the
kmg→/dev/log bridge. Closes: #622555
* Add suggests on Python for systemd-analyze.
* Divert /lib/lsb/init-functions instead of (ab)using
/etc/lsb-base-logging.sh for diverting calls to /etc/init.d/*
* Remove obsolete conffile /etc/lsb-base-logging.sh. Closes: #619093
-- Tollef Fog Heen <tfheen@debian.org> Thu, 21 Apr 2011 13:50:13 +0200
......
# -*-Shell-script-*-
# /etc/lsb-base-logging.sh
# /lib/lsb/init-functions
if [ -e /sys/fs/cgroup/systemd ] ; then
# Some init scripts use "set -e" and "set -u", we don't want that
# here
set +e
......@@ -18,12 +17,21 @@ if [ -e /sys/fs/cgroup/systemd ] ; then
# Redirect SysV init scripts when executed by the user
if [ $PPID -ne 1 ] && [ -z "$init" ] && [ -z "$_SYSTEMCTL_SKIP_REDIRECT" ] ; then
case "$0" in
case $(readlink -f "$0") in
/etc/init.d/*)
# Don't redirect if the init script has X-Interactive: true
if ! grep -qs "^# X-Interactive:.*true" "$0"; then
_use_systemctl=1
fi
# Redirect if there's a matching .service file in /etc or /lib
local prog=${0##*/}
local service="${prog%.sh}.service"
local fp=$(systemctl -p FragmentPath show $service 2>/dev/null | sed 's/^FragmentPath=//')
case "$fp" in
/lib/systemd/system/*|/etc/systemd/system/*)
_use_systemctl=1
;;
esac
;;
esac
else
......@@ -82,3 +90,5 @@ if [ "$_use_systemctl" = "1" ]; then
exit $?
fi
fi
. /lib/lsb/init-functions.systemd
......@@ -20,4 +20,6 @@ fi
systemd-machine-id-setup
dpkg-maintscript-helper rm_conffile /etc/lsb-base-logging.sh 20-1 systemd -- "$@"
#DEBHELPER#
#! /bin/sh
set -e
if [ "$1" = remove ]; then
dpkg-divert --remove --package systemd --rename \
--divert /lib/lsb/init-functions.systemd /lib/lsb/init-functions
fi
dpkg-maintscript-helper rm_conffile /etc/lsb-base-logging.sh 20-1 systemd -- "$@"
#DEBHELPER#
exit 0
#! /bin/sh
set -e
if [ "$1" = install ] || [ "$1" = upgrade ]; then
dpkg-divert --add --package systemd --rename \
--divert /lib/lsb/init-functions.systemd /lib/lsb/init-functions
fi
dpkg-maintscript-helper rm_conffile /etc/lsb-base-logging.sh 20-1 systemd -- "$@"
#DEBHELPER#
exit 0
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment