[tor-commits] [tor-browser-bundle/master] Revert "Log Tor Browser output to file and disown the process."

mikeperry at torproject.org mikeperry at torproject.org
Thu Jun 26 15:39:58 UTC 2014


commit 27f1353baa0e3ce4dafcebe0eae6b48aa2f8704c
Author: Mike Perry <mikeperry-git at torproject.org>
Date:   Thu Jun 26 08:38:12 2014 -0700

    Revert "Log Tor Browser output to file and disown the process."
    
    This reverts commit c2bd8a5f070e771623aebfb66e95e9e954e5522d.
    
    Reverted due to https://trac.torproject.org/projects/tor/ticket/12472
    and https://trac.torproject.org/projects/tor/ticket/12468. We need to stop
    HTTPS-Everywhere from logging URLs before we do this.
---
 RelativeLink/RelativeLink.sh |   45 +++++++++++-------------------------------
 1 file changed, 12 insertions(+), 33 deletions(-)

diff --git a/RelativeLink/RelativeLink.sh b/RelativeLink/RelativeLink.sh
index 86a40d9..4e6b7bb 100755
--- a/RelativeLink/RelativeLink.sh
+++ b/RelativeLink/RelativeLink.sh
@@ -284,41 +284,20 @@ setControlPortPasswd ${TOR_CONTROL_PASSWD:='"secret"'}
 
 # XXX: Debug mode for Firefox??
 
+# not in debug mode, run proceed normally
 printf "Launching Tor Browser for Linux in ${HOME}...\n"
 cd "${HOME}"
-logfile=${PWD}/tbb-debug.log
-touch $logfile && printf "Logging Tor Browser output to file: %s\n" "${logfile}"
-
-# !!! We pass command-line arguments we got (except --debug) to Firefox.
+# XXX Someday we should pass whatever command-line arguments we got
+# (probably filenames or URLs) to Firefox.
+# !!! Dash above comment! Now we pass command-line arguments we got (except --debug) to Firefox.
 # !!! Use at your own risk!
 # Adding --class for fixing bug 11102.
-TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD} ./firefox --class "Tor Browser" \
-    -profile TorBrowser/Data/Browser/profile.default "${@}" > $logfile 2>&1 </dev/null &
-
-pid="$!"
-
-for second in `seq 1 15` ; do
-    sleep 1
-    # Doing `kill -0` doesn't send a signal to the process, but it'll yell
-    # "No such process" if that process doesn't exist (i.e. it already died):
-    if `kill -0 $pid 2>&1 >/dev/null` ; then
-        wait "$pid"
-        exitcode="$?"
-        complain "Tor Browser exited abnormally. Exit code: $exitcode "
-        exit "$exitcode"
-    else
-        continue
-    fi
-done
-
-if test -z "${exitcode}" ; then
-    if test -z "$(kill -0 $pid 2>&1 >/dev/null)" ; then
-        printf "Running Tor Browser process (PID %s) in background...\n" "$pid"
-        disown "$pid"
-        exitcode="0"
-    else
-        exitcode="66"  # Something odd happened
-    fi
+TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD} ./firefox  --class "Tor Browser" \
+    -profile TorBrowser/Data/Browser/profile.default "${@}"
+exitcode="$?"
+if [ "$exitcode" -ne 0 ]; then
+	complain "Tor Browser exited abnormally.  Exit code: $exitcode"
+	exit "$exitcode"
+else
+	printf '\nTor Browser exited cleanly.\n'
 fi
-
-exit "$exitcode"



More information about the tor-commits mailing list