[or-cvs] r13208: postinst: if we reboot between unpacking and configuring on (tor/trunk/debian)

weasel at seul.org weasel at seul.org
Mon Jan 21 15:00:34 UTC 2008


Author: weasel
Date: 2008-01-21 10:00:34 -0500 (Mon, 21 Jan 2008)
New Revision: 13208

Modified:
   tor/trunk/debian/changelog
   tor/trunk/debian/tor.postinst
Log:
postinst: if we reboot between unpacking and configuring on some smart systems
this will mean that we just lost /var/run/tor - creating it in the maintainer
script if it doesn't exist.


Modified: tor/trunk/debian/changelog
===================================================================
--- tor/trunk/debian/changelog	2008-01-21 14:58:20 UTC (rev 13207)
+++ tor/trunk/debian/changelog	2008-01-21 15:00:34 UTC (rev 13208)
@@ -12,8 +12,11 @@
     and then later re-installed again.  Now we ensure proper ownership
     and modes for all the directories and files below /var/{lib,run,log}/tor
     (the dirs themselves included) every time we run postinst.
+  * postinst: if we reboot between unpacking and configuring on some smart
+    systems this will mean that we just lost /var/run/tor - creating it
+    in the maintainer script if it doesn't exist.
 
- -- Peter Palfrader <weasel at debian.org>  Mon, 21 Jan 2008 15:56:12 +0100
+ -- Peter Palfrader <weasel at debian.org>  Mon, 21 Jan 2008 15:59:54 +0100
 
 tor (0.2.0.17-alpha-1) experimental; urgency=low
 

Modified: tor/trunk/debian/tor.postinst
===================================================================
--- tor/trunk/debian/tor.postinst	2008-01-21 14:58:20 UTC (rev 13207)
+++ tor/trunk/debian/tor.postinst	2008-01-21 15:00:34 UTC (rev 13208)
@@ -31,6 +31,14 @@
 fi
 
 
+for i in lib run log; do
+	if ! [ -d "/var/$i/tor" ]; then
+		echo "Something or somebody made /var/$i/tor disappear."
+		echo "Creating one for you again."
+		mkdir "/var/$i/tor"
+	fi
+done
+
 find /var/lib/tor ! -user debian-tor -o ! -group debian-tor -print0 | xargs -0 --no-run-if-empty chown debian-tor:debian-tor
 find /var/lib/tor -type d -print0 | xargs -0 --no-run-if-empty chmod 02700
 find /var/lib/tor -type f -print0 | xargs -0 --no-run-if-empty chmod 00600



More information about the tor-commits mailing list