From 14fe596381d7ab53173b638a096fed9a078e8607 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 12 Oct 2011 07:53:22 +0200 Subject: [PATCH] Automatically migrate TMPTIME settings from /etc/default/rcS --- debian/changelog | 8 ++++++++ debian/systemd.postinst | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3e38c061..b701f4dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ systemd (36-2) unstable; urgency=low + [ Tollef Fog Heen ] * Change the type of the debian-fixup service to oneshot. Closes: #642961 * Add ConditionPathIsDirectory to lib-init-rw.automount and @@ -10,6 +11,13 @@ systemd (36-2) unstable; urgency=low * Blacklist fuse init script, we do the same work already internally. Closes: #643700 + [ Josh Triplett ] + * Do a one-time migration of the $TMPTIME setting from /etc/default/rcS to + /etc/tmpfiles.d/tmp.conf. If /etc/default/rcS has a TMPTIME setting of + "infinite" or equivalent, migrate it to an /etc/tmpfiles.d/tmp.conf that + overrides the default /usr/lib/tmpfiles.d/tmp.conf and avoids clearing + /tmp. Closes: #643698 + -- Tollef Fog Heen Wed, 28 Sep 2011 20:04:13 +0200 systemd (36-1) unstable; urgency=low diff --git a/debian/systemd.postinst b/debian/systemd.postinst index 04f78906..7f7c2daa 100644 --- a/debian/systemd.postinst +++ b/debian/systemd.postinst @@ -16,6 +16,24 @@ if dpkg --compare-versions "$2" lt "33-1"; then 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 <