[or-cvs] r19138: {torvm} Bugfix restarting via init script at shell in debug mode. (torvm/trunk/build/kamikaze/patches)
coderman at seul.org
coderman at seul.org
Fri Mar 27 01:17:09 UTC 2009
Author: coderman
Date: 2009-03-26 21:17:09 -0400 (Thu, 26 Mar 2009)
New Revision: 19138
Modified:
torvm/trunk/build/kamikaze/patches/001-kamikaze-tor-package.patch
Log:
Bugfix restarting via init script at shell in debug mode.
Modified: torvm/trunk/build/kamikaze/patches/001-kamikaze-tor-package.patch
===================================================================
--- torvm/trunk/build/kamikaze/patches/001-kamikaze-tor-package.patch 2009-03-26 13:12:57 UTC (rev 19137)
+++ torvm/trunk/build/kamikaze/patches/001-kamikaze-tor-package.patch 2009-03-27 01:17:09 UTC (rev 19138)
@@ -313,8 +313,8 @@
+
diff -Naur a/package/tor/files/tor.init b/package/tor/files/tor.init
--- a/package/tor/files/tor.init 1970-01-01 00:00:00.000000000 +0000
-+++ b/package/tor/files/tor.init 2009-03-26 06:23:42.161177504 +0000
-@@ -0,0 +1,137 @@
++++ b/package/tor/files/tor.init 2009-03-27 01:11:16.354176848 +0000
+@@ -0,0 +1,138 @@
+#!/bin/sh
+# make sure we check the system bin dirs
+export PATH=/usr/sbin:/sbin:$PATH
@@ -352,7 +352,6 @@
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ chown $RUN_USER:$RUN_GROUP $RUN_D
+ chmod 700 $RUN_D
-+ rm -f $LOG_F >/dev/null 2>&1
+ # append any runtime options as needed
+ TMP_F="${CONF_F}_tmp"; \
+ ARGS=`cat /proc/cmdline` ; \
@@ -364,23 +363,25 @@
+ echo $ARGS | grep ' HASHPW=' >/dev/null 2>&1 ; \
+ if [ $? -eq 0 ]; then \
+ HASHPW=`echo $ARGS | sed 's/.* HASHPW=//' | sed 's/ .*//'`; \
-+ cat $CONF_F | grep -v 'HashedControlPassword' > $TMP_F; \
++ cat $CONF_F | grep -v HashedControlPassword > $TMP_F; \
+ echo "HashedControlPassword ${HASHPW}" >> $TMP_F; \
+ mv -f $TMP_F $CONF_F; \
+ fi; \
+ echo $ARGS | grep ' CTLSOCK=' >/dev/null 2>&1 ; \
+ if [ $? -eq 0 ]; then \
+ CTLADDR=`echo $ARGS | sed 's/.* CTLSOCK=//' | sed 's/ .*//'`; \
++ CTLIP=`echo $CTLADDR | sed 's/:.*//'`; \
+ CTLPORT=`echo $CTLADDR | sed 's/.*://'`; \
-+ cat $CONF_F | grep -v 'ControlListenAddress' | grep -v ControlPort > $TMP_F; \
++ cat $CONF_F | grep -v ControlListenAddress | grep -v ControlPort | grep -v SocksListenAddress | grep -v SocksPort > $TMP_F; \
++ echo "ControlListenAddress ${CTLADDR}" >> $TMP_F; \
+ echo "ControlPort ${CTLPORT}" >> $TMP_F; \
-+ echo "ControlListenAddress ${CTLADDR}" >> $TMP_F; \
-+ echo "SocksListenAddress ${CTLADDR}" >> $TMP_F; \
++ echo "SocksListenAddress ${CTLIP}:9050" >> $TMP_F; \
++ echo "SocksPort 9050" >> $TMP_F; \
+ mv -f $TMP_F $CONF_F; \
+ fi; \
+ chown $RUN_USER:$RUN_GROUP $CONF_F ; \
-+ if [ $FOLLOWTOR -eq 1 ]; then \
-+ /etc/init.d/tor dofollow >/dev/null 2>&1 & \
++ if [ "$FOLLOWTOR" = "1" ]; then \
++ nohup /etc/init.d/tor dofollow >/dev/null 2>&1 & \
+ else \
+ $BIN --runasdaemon 1 -f $CONF_F > $SLOG_F 2>&1 ; \
+ fi;
More information about the tor-commits
mailing list