Commit bb8785d8 authored by Jon Severinsson's avatar Jon Severinsson Committed by Sjoerd Simons
Browse files

Do not force-enable default-on services on every upgrade.

Also drops the systemd-networkd, systemd-resolved and systemd-timesyncd
from the set of default services.
parent 350ebb7d
......@@ -17,6 +17,7 @@ systemd (214-1) UNRELEASED; urgency=medium
systemd-network, systemd-resolve)
* Add new system group "input" used by udev rules in udev postinst.
* Try-restart networkd, resolved, and timesyncd after an upgrade.
* Do not force-enable default-on services on every upgrade.
[ Sjoerd Simons ]
* debian/patches/shared-include-stdbool.h-in-mkdir.h.patch
......
......@@ -119,6 +119,8 @@ override_dh_install:
rm -f debian/install/*/usr/lib/*/libsystemd-login.so
rm -f debian/install/*/usr/lib/*/libsystemd-id128.so
rm -f debian/install/*/usr/lib/*/libsystemd-journal.so
# Remove symlinks enabling default-on services:
rm -rf debian/install/*/etc/systemd/system/*.target.wants/
dh_install -pudev-udeb -plibudev1-udeb --sourcedir=debian/install/udeb
dh_install $(BOOTSTRAP_DH_FLAGS) -Nudev-udeb -Nlibudev1-udeb --sourcedir=debian/install/deb --fail-missing
# install some files manually, --sourcedir makes that necessary
......
......@@ -18,6 +18,14 @@ 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
......@@ -126,4 +134,11 @@ fi
setcap cap_dac_override,cap_sys_ptrace=ep /usr/bin/systemd-detect-virt || true
# 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
#DEBHELPER#
......@@ -23,4 +23,40 @@ if [ "$1" = "install" ] || [ "$1" = "upgrade" ] && [ -n "$2" ] && dpkg --compare
preserve_unit "var-run.mount"
fi
# When the [Install] section of an enabled unit changes `systemctl enable` has
# to be re-run in postinst. As systemctl is-enabled will use the new unit files
# in postinst we must run it before unpacking it and remember the results.
save_is_enabled() {
if systemctl --quiet is-enabled $1 2>/dev/null ; then
echo $1 >>/run/systemd/was-enabled
fi
}
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" ge "204"; then
[ -d /run/systemd ] || mkdir /run/systemd
rm -f /run/systemd/was-enabled
save_is_enabled console-getty.service
save_is_enabled console-shell.service
save_is_enabled debug-shell.service
save_is_enabled getty@tty1.service
save_is_enabled remote-fs.target
save_is_enabled rescue.target
save_is_enabled systemd-readahead-collect.service
save_is_enabled systemd-readahead-replay.service
if dpkg --compare-versions "$2" ge "204-8~" ; then
save_is_enabled tmp.mount
fi
if dpkg --compare-versions "$2" ge "209" ; then
save_is_enabled systemd-networkd.service
fi
if dpkg --compare-versions "$2" ge "211" ; then
save_is_enabled systemd-networkd-wait-online.service
fi
if dpkg --compare-versions "$2" ge "213" ; then
save_is_enabled systemd-resolved.service
save_is_enabled systemd-timesyncd.service
fi
fi
#DEBHELPER#
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