]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
openSUSE initscript create /var/run/tor fixes Ticket #2573
authorAndreas Stieger <andreas.stieger@gmx.de>
Wed, 9 Mar 2011 20:41:25 +0000 (20:41 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 9 Mar 2011 21:18:44 +0000 (16:18 -0500)
(changes file added by nickm)

changes/bug2574 [new file with mode: 0644]
contrib/suse/tor.sh.in

diff --git a/changes/bug2574 b/changes/bug2574
new file mode 100644 (file)
index 0000000..7022749
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor packaging issues
+    - Create the /var/run/tor directory on startup on OpenSUSE if it is
+      not already created.  Patch from Andreas Stieger.  Fixes bug 2574.
index 5dad6499b9d1f0f69578b411a6f96e8307ebdc30..b7e9005eb5efa8f2c14105be79193c2997e754b3 100644 (file)
@@ -51,6 +51,8 @@ export TORUSER
 TORGROUP=@TORGROUP@
 export TORGROUP
 
+TOR_DAEMON_PID_DIR="@LOCALSTATEDIR@/run/tor"
+
 if [ -x /bin/su ] ; then
     SUPROG=/bin/su
 elif [ -x /sbin/su ] ; then
@@ -67,6 +69,12 @@ case "$1" in
 
     start)
     echo "Starting tor daemon"
+
+    if [ ! -d $TOR_DAEMON_PID_DIR ] ; then
+        mkdir -p $TOR_DAEMON_PID_DIR
+        chown $TORUSER:$TORGROUP $TOR_DAEMON_PID_DIR
+    fi
+
     ## Start daemon with startproc(8). If this fails
     ## the echo return value is set appropriate.