Commit 0c504dd6 authored by Michael Biebl's avatar Michael Biebl Committed by Martin Pitt
Browse files

systemd.postinst: Move unit enablement after restarting systemd

So that we don't fail to enable units with keywords that wheezy's systemd does
not understand yet. Fixes enabling getty units on wheezy upgrades with systemd.

Closes: #771204
parent db6ad7b9
......@@ -33,6 +33,12 @@ systemd (215-8) UNRELEASED; urgency=medium
make sure that the udev package has appropriate Breaks:. In particular,
this avoids installing current udev with kmod << 14. (Closes: #771726)
[ Michael Biebl ]
* systemd.postinst: Move unit enablement after restarting systemd, so that
we don't fail to enable units with keywords that wheezy's systemd does not
understand yet. Fixes enabling getty units on wheezy upgrades with
systemd. (Closes: #771204)
-- Sjoerd Simons <sjoerd@debian.org> Mon, 01 Dec 2014 22:44:48 +0100
systemd (215-7) unstable; urgency=medium
......
......@@ -18,14 +18,6 @@ if [ "$1" = "triggered" ]; then
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
# Cleanup state files from the auto-enabler which we used in wheezy
if dpkg --compare-versions "$2" lt "204-1"; then
rm -f /var/lib/systemd/enabled-units
......@@ -123,13 +115,6 @@ if [ -d /var/log/journal ]; then
setfacl -R -nm g:adm:rx,d:g:adm:rx /var/log/journal || true
fi
# Re-run systemctl enable for any service that was enabled when preinst was run.
if dpkg --compare-versions "$2" ge "204"; then
while read UNIT ; do
systemctl enable $UNIT || true
done </run/systemd/was-enabled || true
fi
if [ -n "$2" ]; then
_systemctl daemon-reexec || true
_systemctl try-restart systemd-logind.service || true
......@@ -138,6 +123,21 @@ if [ -n "$2" ]; then
_systemctl try-restart systemd-timesyncd.service || true
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
# Re-run systemctl enable for any service that was enabled when preinst was run.
if dpkg --compare-versions "$2" ge "204"; then
while read UNIT ; do
systemctl enable $UNIT || true
done </run/systemd/was-enabled || true
fi
# The /dev/log socket and /dev/initctl FIFO have been moved to /run and
# replaced by symlinks. Create the symlinks manually on upgrades as well.
# (https://bugs.debian.org/761340). Note that this will break the current
......
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