Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: remoting/host/installer/mac/PrivilegedHelperTools/org.chromium.chromoting.me2me.sh

Issue 12213059: Direct host output to a specific log file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 2
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # Version = @@VERSION@@ 7 # Version = @@VERSION@@
8 8
9 NAME=org.chromium.chromoting 9 NAME=org.chromium.chromoting
10 CONFIG_DIR=/Library/PrivilegedHelperTools 10 CONFIG_DIR=/Library/PrivilegedHelperTools
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 # the signal that was trapped + 128. Forward the signal to the host. 94 # the signal that was trapped + 128. Forward the signal to the host.
95 SIGNAL_WAS_TRAPPED=0 95 SIGNAL_WAS_TRAPPED=0
96 local SIGNAL=$(($EXIT_CODE - 128)) 96 local SIGNAL=$(($EXIT_CODE - 128))
97 echo "Forwarding signal $SIGNAL to host" 97 echo "Forwarding signal $SIGNAL to host"
98 kill -$SIGNAL "$HOST_PID" 98 kill -$SIGNAL "$HOST_PID"
99 elif [[ "$EXIT_CODE" -eq "0" || 99 elif [[ "$EXIT_CODE" -eq "0" ||
100 "$EXIT_CODE" -eq "$SIGTERM_EXIT_CODE" || 100 "$EXIT_CODE" -eq "$SIGTERM_EXIT_CODE" ||
101 "$EXIT_CODE" -eq "$PERMISSION_DENIED_PARENTAL_CONTROL" || 101 "$EXIT_CODE" -eq "$PERMISSION_DENIED_PARENTAL_CONTROL" ||
102 ("$EXIT_CODE" -ge "$MIN_PERMANENT_ERROR_EXIT_CODE" && \ 102 ("$EXIT_CODE" -ge "$MIN_PERMANENT_ERROR_EXIT_CODE" && \
103 "$EXIT_CODE" -le "$MAX_PERMANENT_ERROR_EXIT_CODE") ]]; then 103 "$EXIT_CODE" -le "$MAX_PERMANENT_ERROR_EXIT_CODE") ]]; then
104 echo "Host returned permanent exit code $EXIT_CODE" 104 echo "Host returned permanent exit code $EXIT_CODE at ""$(date)"""
105 if [[ "$EXIT_CODE" -eq 101 ]]; then 105 if [[ "$EXIT_CODE" -eq 101 ]]; then
106 # Exit code 101 is "hostID deleted", which indicates that the host 106 # Exit code 101 is "hostID deleted", which indicates that the host
107 # was taken off-line remotely. To prevent the host being restarted 107 # was taken off-line remotely. To prevent the host being restarted
108 # when the login context changes, try to delete the "enabled" file. 108 # when the login context changes, try to delete the "enabled" file.
109 # Since this requires root privileges, this is only possible when 109 # Since this requires root privileges, this is only possible when
110 # this script is launched in the "login" context. In the "aqua" 110 # this script is launched in the "login" context. In the "aqua"
111 # context, just exit and try again next time. 111 # context, just exit and try again next time.
112 echo "Host id deleted - disabling" 112 echo "Host id deleted - disabling"
113 rm -f "$ENABLED_FILE" 2>/dev/null 113 rm -f "$ENABLED_FILE" 2>/dev/null
114 fi 114 fi
115 exit "$EXIT_CODE" 115 exit "$EXIT_CODE"
116 else 116 else
117 # Ignore non-permanent error-code and launch host again. Stop handling 117 # Ignore non-permanent error-code and launch host again. Stop handling
118 # signals temporarily in case the script has to sleep to throttle host 118 # signals temporarily in case the script has to sleep to throttle host
119 # relaunches. While throttling, there is no host process to which to 119 # relaunches. While throttling, there is no host process to which to
120 # forward the signal, so the default behaviour should be restored. 120 # forward the signal, so the default behaviour should be restored.
121 echo "Host returned non-permanent exit code $EXIT_CODE" 121 echo "Host returned non-permanent exit code $EXIT_CODE at ""$(date)"""
122 trap - $SIGNAL_LIST 122 trap - $SIGNAL_LIST
123 HOST_PID=0 123 HOST_PID=0
124 break 124 break
125 fi 125 fi
126 done 126 done
127 done 127 done
128 } 128 }
129 129
130 if [[ "$1" = "--disable" ]]; then 130 if [[ "$1" = "--disable" ]]; then
131 # This script is executed from base::mac::ExecuteWithPrivilegesAndWait(), 131 # This script is executed from base::mac::ExecuteWithPrivilegesAndWait(),
(...skipping 14 matching lines...) Expand all
146 echo $$ 146 echo $$
147 cat > "$CONFIG_FILE" 147 cat > "$CONFIG_FILE"
148 elif [[ "$1" = "--host-version" ]]; then 148 elif [[ "$1" = "--host-version" ]]; then
149 /usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$PLIST_FILE" 149 /usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$PLIST_FILE"
150 elif [[ "$1" = "--relaunch-prefpane" ]]; then 150 elif [[ "$1" = "--relaunch-prefpane" ]]; then
151 # Wait for the parent (System Preferences applet) to die, by reading from 151 # Wait for the parent (System Preferences applet) to die, by reading from
152 # stdin until the pipe is broken. 152 # stdin until the pipe is broken.
153 cat 2>/dev/null || true 153 cat 2>/dev/null || true
154 open "$PREF_PANE_BUNDLE" 154 open "$PREF_PANE_BUNDLE"
155 elif [[ "$1" = "--run-from-launchd" ]]; then 155 elif [[ "$1" = "--run-from-launchd" ]]; then
156 echo Host started for user $USER at $"$(date)"
156 run_host 157 run_host
157 else 158 else
158 echo $$ 159 echo $$
159 exit 1 160 exit 1
160 fi 161 fi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698