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

Side by Side Diff: remoting/host/installer/linux/debian/chrome-remote-desktop.init

Issue 15848019: Use sudo in remoting init.d script to get a clean per-user environment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 ### BEGIN INIT INFO 3 ### BEGIN INIT INFO
4 # Provides: chrome-remote-desktop 4 # Provides: chrome-remote-desktop
5 # Required-Start: $remote_fs $syslog 5 # Required-Start: $remote_fs $syslog
6 # Required-Stop: $remote_fs $syslog 6 # Required-Stop: $remote_fs $syslog
7 # Default-Start: 2 3 4 5 7 # Default-Start: 2 3 4 5
8 # Default-Stop: 0 1 6 8 # Default-Stop: 0 1 6
9 # Short-Description: Chrome Remote Desktop service 9 # Short-Description: Chrome Remote Desktop service
10 ### END INIT INFO 10 ### END INIT INFO
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 run_and_ignore_error() { 49 run_and_ignore_error() {
50 user=$1 50 user=$1
51 shift 51 shift
52 exec=$1 52 exec=$1
53 shift 53 shift
54 54
55 set +e 55 set +e
56 if [ "$(whoami)" = "$user" ]; then 56 if [ "$(whoami)" = "$user" ]; then
57 "$exec" "$@" 57 "$exec" "$@"
58 else 58 else
59 shell="$(getent passwd "$user" | cut -d: -f7)" 59 shell="$(getent passwd "$user" | cut -d: -f7)"
Jamie 2013/06/06 22:13:04 Remove this line?
Lambros 2013/06/07 01:22:17 Done.
60 USER="$user" LOGNAME="$user" SHELL="$shell" start-stop-daemon \ 60 sudo -i -b -u "$user" start-stop-daemon --exec "$exec" --start -- "$@"
Jamie 2013/06/06 22:13:04 According to the man page, the command should foll
Sergey Ulanov 2013/06/06 22:22:44 Why do you still need start-stop-daemon here? run
Lambros 2013/06/07 01:22:17 Done.
Lambros 2013/06/07 01:22:17 Yeah, I don't think start-stop-daemon does anythin
61 --chuid "$user" --exec "$exec" --start -- "$@"
62 fi 61 fi
63 } 62 }
64 63
65 do_start() { 64 do_start() {
66 log_begin_msg "Starting Chrome Remote Desktop host for $1..." 65 log_begin_msg "Starting Chrome Remote Desktop host for $1..."
67 run_and_ignore_error $1 "$HOST_PATH" --start 66 run_and_ignore_error $1 "$HOST_PATH" --start
68 log_end_msg $? 67 log_end_msg $?
69 } 68 }
70 69
71 do_stop() { 70 do_stop() {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 for_each_user do_restart 109 for_each_user do_restart
111 ;; 110 ;;
112 111
113 *) 112 *)
114 log_success_msg "Usage: /etc/init.d/chrome-remote-desktop" \ 113 log_success_msg "Usage: /etc/init.d/chrome-remote-desktop" \
115 "{start|stop|reload|force-reload|restart}" 114 "{start|stop|reload|force-reload|restart}"
116 exit 1 115 exit 1
117 esac 116 esac
118 117
119 exit 0 118 exit 0
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698