SF.net SVN: gar:[24217] csw/mgar/pkg/tor/branches/alpha/files/cswtor

jake_goerzen at users.sourceforge.net jake_goerzen at users.sourceforge.net
Sun Oct 26 22:36:13 CET 2014


Revision: 24217
          http://sourceforge.net/p/gar/code/24217
Author:   jake_goerzen
Date:     2014-10-26 21:36:10 +0000 (Sun, 26 Oct 2014)
Log Message:
-----------
tor: update cswinitsmf init script to run as non-root user

Modified Paths:
--------------
    csw/mgar/pkg/tor/branches/alpha/files/cswtor

Modified: csw/mgar/pkg/tor/branches/alpha/files/cswtor
===================================================================
--- csw/mgar/pkg/tor/branches/alpha/files/cswtor	2014-10-26 21:17:00 UTC (rev 24216)
+++ csw/mgar/pkg/tor/branches/alpha/files/cswtor	2014-10-26 21:36:10 UTC (rev 24217)
@@ -2,14 +2,16 @@
 
 #FMRI network
 
+SU=/bin/su
 DAEMON=/opt/csw/bin/tor
 CONF=/etc/opt/csw/tor/torrc
-pidfile=/var/opt/csw/run/tor.pid
+pidfile=/tmp/tor.pid
+TOR_USER="tor"
 
 case "$1" in
   start)
     echo "Starting Tor"
-    $DAEMON --RunAsDaemon 1 --PidFile /var/opt/csw/run/tor.pid
+    $SU - $TOR_USER -c "$DAEMON --RunAsDaemon 1 --PidFile $pidfile"
     ;;
   stop)
     echo "Stopping Tor"
@@ -19,7 +21,7 @@
     echo "Restarting Tor"
     kill `cat $pidfile`
     sleep 1
-    $DAEMON --RunAsDaemon 1 --PidFile /var/opt/csw/run/tor.pid
+    $SU - $TOR_USER -c "$DAEMON --RunAsDaemon 1 --PidFile $pidfile"
     ;;
   *)
     echo "Usage: $0 { start | stop | restart }"

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list