]> err.no Git - systemd/commitdiff
Automatically migrate TMPTIME settings from /etc/default/rcS
authorJosh Triplett <josh@joshtriplett.org>
Wed, 12 Oct 2011 05:53:22 +0000 (07:53 +0200)
committerTollef Fog Heen <tfheen@err.no>
Wed, 12 Oct 2011 05:53:22 +0000 (07:53 +0200)
debian/changelog
debian/systemd.postinst

index 3e38c061bf7569528a8678893525cebddc687592..b701f4dd6539e2d7537a2351a596fa881cfea935 100644 (file)
@@ -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 <tfheen@debian.org>  Wed, 28 Sep 2011 20:04:13 +0200
 
 systemd (36-1) unstable; urgency=low
index 04f78906429898614884149d4093e3b570f2d1bb..7f7c2daacacd4b2ae908a79d8c91631ba2bca2a5 100644 (file)
@@ -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 <<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 -- "$@"