tor: fix tor init script (#2279)
authorolli <olli@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 28 Aug 2007 17:09:49 +0000 (17:09 +0000)
committerolli <olli@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 28 Aug 2007 17:09:49 +0000 (17:09 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@8532 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/tor/files/tor.init
net/tor/files/torrc

index a6b8235..6944e88 100644 (file)
@@ -5,13 +5,17 @@ START=50
 BIN=tor
 DEFAULT=/etc/default/$BIN
 LOG_D=/var/log/$BIN
+LIB_D=/var/lib/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
+RUN_USER=$BIN
+RUN_GROUP=$BIN
 
 start() {
        [ -f $DEFAULT ] && . $DEFAULT
-       mkdir -p $LOG_D
-       mkdir -p $RUN_D
+       [ -d $LIB_D ] || mkdir -p $LOG_D
+       [ -d $LIB_D ] || ( mkdir -p $LIB_D && chown $RUN_USER:$RUN_GROUP $LIB_D )
+       [ -d $RUN_D ] || mkdir -p $RUN_D
        $BIN $OPTIONS
 }
 
index e5cf75b..edb7191 100644 (file)
@@ -59,7 +59,7 @@ RunAsDaemon 1
 
 ## The directory for keeping all the keys/etc. By default, we store
 ## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.
-#DataDirectory /var/lib/tor
+DataDirectory /var/lib/tor
 
 ## The port on which Tor will listen for local connections from Tor controller
 ## applications, as documented in control-spec.txt.  NB: this feature is