]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Only create pid dir if we are about to start Tor (Luca Capello, closes: #447508)
authorPeter Palfrader <peter@palfrader.org>
Sun, 21 Oct 2007 22:12:24 +0000 (22:12 +0000)
committerPeter Palfrader <peter@palfrader.org>
Sun, 21 Oct 2007 22:12:24 +0000 (22:12 +0000)
svn:r12085

debian/changelog
debian/tor.init

index 6d3ff261a57760f826d8abed6dfe0f65b0433010..7745d2599af294550f1a7ff9b250d22f8709dc3f 100644 (file)
@@ -1,3 +1,10 @@
+tor (0.2.0.8-alpha-1+svn) experimentalX; urgency=low
+
+  * Only create pid dir if we are about to start Tor (Luca Capello,
+    closes: #447508).
+
+ -- Peter Palfrader <weasel@debian.org>  Mon, 22 Oct 2007 00:11:15 +0200
+
 tor (0.2.0.8-alpha-1) experimental; urgency=low
 
   * New upstream version.
index e4a9310666738f6c0ff807b7eabf11392b13e7d8..8333ff5da58497e942125d64a2258db96e5efaaf 100644 (file)
@@ -61,16 +61,18 @@ wait_for_deaddaemon () {
 }
 
 
-if test ! -d $TORPIDDIR; then
-       echo "There is no $TORPIDDIR directory.  Creating one for you."
-       mkdir -m 02700 "$TORPIDDIR"
-       chown debian-tor:debian-tor "$TORPIDDIR"
-fi
+check_torpiddir () {
+       if test ! -d $TORPIDDIR; then
+               echo "There is no $TORPIDDIR directory.  Creating one for you."
+               mkdir -m 02700 "$TORPIDDIR"
+               chown debian-tor:debian-tor "$TORPIDDIR"
+       fi
 
-if test ! -x $TORPIDDIR; then
-       echo "Cannot access $TORPIDDIR directory, are you root?" >&2
-       exit 1
-fi
+       if test ! -x $TORPIDDIR; then
+               echo "Cannot access $TORPIDDIR directory, are you root?" >&2
+               exit 1
+       fi
+}
 
 
 case "$1" in
@@ -89,6 +91,8 @@ case "$1" in
                fi
        fi
 
+       check_torpiddir
+
        echo "Starting $DESC: $NAME..."
        if ! su -s /bin/sh -c "$DAEMON --verify-config" debian-tor > /dev/null; then
                echo "ABORTED: Tor configuration invalid:" >&2