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
|
#! /bin/sh
set -e
#DEBHELPER#
# Start services conditionally rather than relying on debhelper, in order to
# handle udev activation under systemd.
case $1 in
configure|abort-upgrade|abort-deconfigure|abort-remove)
if [ -d /run/systemd/system ]; then
# If we're on systemd, restart services if they're running
# or if the ipr kernel module is loaded, but otherwise leave
# services stopped until they're activated by udev.
systemctl --system daemon-reload >/dev/null || true
deb-systemd-invoke try-restart \
iprinit.service iprdump.service iprupdate.service \
>/dev/null || true
if [ -d /sys/module/ipr ]; then
deb-systemd-invoke restart iprutils.target \
>/dev/null || true
fi
else
# If we're not on systemd, just (re)start services as
# normal.
if [ "$2" ]; then
action=restart
else
action=start
fi
for script in iprinit iprdump iprupdate; do
if [ -x "/etc/init.d/$script" ]; then
invoke-rc.d "$script" "$action" || exit 1
fi
done
fi
;;
esac
exit 0
|