[tor-commits] [tor/release-0.2.2] openSUSE initscript create /var/run/tor fixes Ticket #2573

arma at torproject.org arma at torproject.org
Fri Mar 11 22:42:13 UTC 2011


commit f31ba6a3566e9f7bba827adfebe865c8179a06db
Author: Andreas Stieger <andreas.stieger at gmx.de>
Date:   Wed Mar 9 20:41:25 2011 +0000

    openSUSE initscript create /var/run/tor fixes Ticket #2573
    
    (changes file added by nickm)
---
 changes/bug2574        |    3 +++
 contrib/suse/tor.sh.in |    8 ++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/changes/bug2574 b/changes/bug2574
new file mode 100644
index 0000000..7022749
--- /dev/null
+++ b/changes/bug2574
@@ -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.
diff --git a/contrib/suse/tor.sh.in b/contrib/suse/tor.sh.in
index 5dad649..b7e9005 100644
--- a/contrib/suse/tor.sh.in
+++ b/contrib/suse/tor.sh.in
@@ -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.
 





More information about the tor-commits mailing list