Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 HELPERTOOLS=/Library/PrivilegedHelperTools | 9 HELPERTOOLS=/Library/PrivilegedHelperTools |
| 10 NAME=org.chromium.chromoting | 10 NAME=org.chromium.chromoting |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 password required pam_deny.so | 53 password required pam_deny.so |
| 54 session required pam_deny.so | 54 session required pam_deny.so |
| 55 | 55 |
| 56 # This file is auto-updated by the Chrome Remote Desktop installer. | 56 # This file is auto-updated by the Chrome Remote Desktop installer. |
| 57 $CONTROL_LINE | 57 $CONTROL_LINE |
| 58 EOF | 58 EOF |
| 59 else | 59 else |
| 60 logger PAM config has local edits. Not updating. | 60 logger PAM config has local edits. Not updating. |
| 61 fi | 61 fi |
| 62 | 62 |
| 63 # Create the log file (if this isn't created ahead of time | |
| 64 # then directing output from the service there won't work). | |
| 65 # We also have to make sure that the file is read/write by all. | |
| 66 touch /var/log/org.chromium.chromoting.log | |
| 67 chmod a+rw /var/log/org.chromium.chromoting.log | |
|
Jamie
2013/02/07 02:22:16
I wonder if this would be better done as part of t
| |
| 68 | |
| 63 # Load the service. | 69 # Load the service. |
| 64 # The launchctl command we'd like to run: | 70 # The launchctl command we'd like to run: |
| 65 # launchctl load -w -S Aqua $PLIST | 71 # launchctl load -w -S Aqua $PLIST |
| 66 # However, since we're installing as an admin, the launchctl command is run | 72 # However, since we're installing as an admin, the launchctl command is run |
| 67 # as if it had a sudo prefix, which means it tries to load the service in | 73 # as if it had a sudo prefix, which means it tries to load the service in |
| 68 # system rather than user space. | 74 # system rather than user space. |
| 69 # To launch the service in user space, we need to get the current user (using | 75 # To launch the service in user space, we need to get the current user (using |
| 70 # ps and grepping for the loginwindow.app) and run the launchctl cmd as that | 76 # ps and grepping for the loginwindow.app) and run the launchctl cmd as that |
| 71 # user (using launchctl bsexec). | 77 # user (using launchctl bsexec). |
| 72 set `ps aux | grep loginwindow.app | grep -v grep` | 78 set `ps aux | grep loginwindow.app | grep -v grep` |
| 73 USERNAME=$1 | 79 USERNAME=$1 |
| 74 USERID=$2 | 80 USERID=$2 |
| 75 if [[ -n "$USERNAME" && -n "$USERID" ]]; then | 81 if [[ -n "$USERNAME" && -n "$USERID" ]]; then |
| 76 launchctl bsexec "$USERID" sudo -u "$USERNAME" launchctl load -w -S Aqua "$PLI ST" | 82 launchctl bsexec "$USERID" sudo -u "$USERNAME" launchctl load -w -S Aqua "$PLI ST" |
| 77 fi | 83 fi |
| 78 | 84 |
| 79 # Register a ticket with Keystone so we're updated. | 85 # Register a ticket with Keystone so we're updated. |
| 80 $KSADMIN --register --productid "$KSPID" --version "$KSPVERSION" --xcpath "$PLIS T" --url "$KSUPDATE" | 86 $KSADMIN --register --productid "$KSPID" --version "$KSPVERSION" --xcpath "$PLIS T" --url "$KSUPDATE" |
| OLD | NEW |