#! /bin/sh set -e _systemctl() { if [ -d /run/systemd/system ]; then systemctl "$@" fi } _update_catalog() { journalctl --update-catalog || true } # Update Message Catalogs database and reload in response to dpkg triggers if [ "$1" = "triggered" ]; then shift for trigger in "$@"; do case $trigger in /usr/lib/systemd/catalog) _update_catalog ;; /etc/init.d) _systemctl daemon-reload || true ;; esac done exit 0 fi # Enable getty and remote-fs.target by default on new installs, and on # upgrades from old systemd versions (where the symlinks included as deb # content, and will thus have been removed by dpkg during the upgrade). if dpkg --compare-versions "$2" lt "214-1"; then systemctl enable getty@tty1.service || true systemctl enable remote-fs.target || true fi # Enable timesyncd by default on new installs installs and upgrades if dpkg --compare-versions "$2" lt "218-11~"; then systemctl enable systemd-timesyncd.service || true fi # Do a one-time migration of the local time setting if dpkg --compare-versions "$2" lt "33-1"; then if [ -f /etc/default/rcS ]; then . /etc/default/rcS fi if [ "$UTC" = "no" ] && [ ! -e /etc/adjtime ]; then printf "0.0 0 0.0\n0\nLOCAL\n" > /etc/adjtime fi fi # Do a one-time migration of the TMPTIME setting if dpkg --compare-versions "$2" lt "204-9"; then # Fix up potentially broken tmp.conf, see Debian#738862 if [ -e /etc/tmpfiles.d/tmp.conf ]; then sed -i '/^# Clear \/var\/tmp/d' /etc/tmpfiles.d/tmp.conf sed -i 's,^\(d /var/tmp\),#\1,g' /etc/tmpfiles.d/tmp.conf fi if [ -f /etc/default/rcS ]; then . /etc/default/rcS fi if [ ! -e /etc/tmpfiles.d/tmp.conf ]; then case "$TMPTIME" in -*|infinite|infinity) cat > /etc/tmpfiles.d/tmp.conf < /dev/null || true done fi #DEBHELPER#