systemd/debian/systemd.postinst

46 lines
1.3 KiB
Bash

#! /bin/sh
set -e
if [ -n "$2" ]; then
systemctl daemon-reexec || 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" > /etc/adjtime
fi
fi
# Do a one-time migration of the TMPTIME setting
if dpkg --compare-versions "$2" lt "36-2"; then
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 <<EOF
# Automatically migrated from TMPTIME in /etc/default/rcS
# Clear /var/tmp as in /usr/lib/tmpfiles.d/tmp.conf, but avoid clearing /tmp
d /var/tmp 1777 root root 30d
EOF
;;
esac
fi
fi
systemd-machine-id-setup
dpkg-maintscript-helper rm_conffile /etc/lsb-base-logging.sh 20-1 systemd -- "$@"
dpkg-maintscript-helper rm_conffile /etc/tmpfiles.d/legacy.conf 25-2 systemd -- "$@"
dpkg-maintscript-helper rm_conffile /etc/tmpfiles.d/systemd.conf 25-2 systemd -- "$@"
dpkg-maintscript-helper rm_conffile /etc/tmpfiles.d/x11.conf 25-2 systemd -- "$@"
#DEBHELPER#