diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-06-05 14:44:27 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-06-05 14:44:27 +0000 |
commit | a94d7256ea9b4d944a6588bd5d67a1c046553a8b (patch) | |
tree | 79b19f45520a48a99915c84eec10af66ba9d7c5f /contrib/tor.sh.in | |
parent | 9f24078452d53b859d15e032b3aa88f244da8ecd (diff) | |
download | tor-a94d7256ea9b4d944a6588bd5d67a1c046553a8b.tar.gz tor-a94d7256ea9b4d944a6588bd5d67a1c046553a8b.zip |
[bug 144] Have torctl.in/tor.sh.in check for location of su binary.
svn:r4311
Diffstat (limited to 'contrib/tor.sh.in')
-rw-r--r-- | contrib/tor.sh.in | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/tor.sh.in b/contrib/tor.sh.in index b0a76314dd..2fc35b8410 100644 --- a/contrib/tor.sh.in +++ b/contrib/tor.sh.in @@ -24,6 +24,18 @@ if [ "x$TORGROUP" != "x" ]; then fi RETVAL=0 +if [ -x /bin/su ] ; then + SUPROG=/bin/su +elif [ -x /sbin/su ] ; then + SUPROG=/sbin/su +elif [ -x /usr/bin/su ] ; then + SUPROG=/usr/bin/su +elif [ -x /usr/sbin/su ] ; then + SUPROG=/usr/sbin/su +else + SUPROG=/bin/su +fi + case "$1" in start) @@ -36,7 +48,7 @@ case "$1" in if [ "x$TORUSER" = "x" ]; then $TORBIN -f $TORCONF $TORARGS else - /bin/su -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER + $SUPROG -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER fi RETVAL=$? if [ $RETVAL -eq 0 ]; then |