#! /bin/sh

set -e

pam-auth-update --package

# upgrading from pre-204 needs a reboot due to changed cgroup layout,
# restarting logind after the upgrade would lose all existing sessions
if dpkg --compare-versions "$2" lt-nl 204 &&
   [ -x /usr/share/update-notifier/notify-reboot-required ]; then
    /usr/share/update-notifier/notify-reboot-required
fi

# Automatically added by dh_installinit
if [ -x "/etc/init.d/systemd-logind" ] || [ -e "/etc/init/systemd-logind.conf" ]; then
	if [ ! -e "/etc/init/systemd-logind.conf" ]; then
		update-rc.d systemd-logind defaults >/dev/null
	fi
	invoke-rc.d systemd-logind start || exit $?
fi
# End automatically added section
# Automatically added by dh_installinit
update-rc.d -f systemd-logind remove >/dev/null || exit $?
# End automatically added section

