| Index: remoting/host/installer/linux/debian/chrome-remote-desktop.init
|
| diff --git a/remoting/host/installer/linux/debian/chrome-remote-desktop.init b/remoting/host/installer/linux/debian/chrome-remote-desktop.init
|
| index 4230632e8131f5880f32e0c1aa366dc4ff1a2be7..2fc0d0deeb39ea862286ded38df7b1ba11a1eef5 100755
|
| --- a/remoting/host/installer/linux/debian/chrome-remote-desktop.init
|
| +++ b/remoting/host/installer/linux/debian/chrome-remote-desktop.init
|
| @@ -46,25 +46,32 @@ run_with_timeout() {
|
| return 1
|
| }
|
|
|
| +# Usage: run_and_ignore_error [--login] user program [args...]
|
| +# --login:
|
| +# Run program in a clean login shell. This requires backgrounding, since
|
| +# the user's .profile or .login script might be run, which might contain
|
| +# blocking commands.
|
| run_and_ignore_error() {
|
| + login_options=""
|
| + if [ "$1" = "--login" ]; then
|
| + login_options="-b -i"
|
| + shift
|
| + fi
|
| +
|
| user=$1
|
| shift
|
| - exec=$1
|
| - shift
|
|
|
| set +e
|
| if [ "$(whoami)" = "$user" ]; then
|
| - "$exec" "$@"
|
| + "$@"
|
| else
|
| - shell="$(getent passwd "$user" | cut -d: -f7)"
|
| - USER="$user" LOGNAME="$user" SHELL="$shell" start-stop-daemon \
|
| - --chuid "$user" --exec "$exec" --start -- "$@"
|
| + sudo -u "$user" $login_options "$@"
|
| fi
|
| }
|
|
|
| do_start() {
|
| log_begin_msg "Starting Chrome Remote Desktop host for $1..."
|
| - run_and_ignore_error $1 "$HOST_PATH" --start
|
| + run_and_ignore_error --login $1 "$HOST_PATH" --start
|
| log_end_msg $?
|
| }
|
|
|
| @@ -83,7 +90,7 @@ do_reload() {
|
| do_restart() {
|
| log_begin_msg "Restarting Chrome Remote Desktop host for $1..."
|
| run_and_ignore_error $1 "$HOST_PATH" --stop
|
| - run_and_ignore_error $1 "$HOST_PATH" --start
|
| + run_and_ignore_error --login $1 "$HOST_PATH" --start
|
| log_end_msg $?
|
| }
|
|
|
|
|