Hello everyone,
I already configured this kind of launch agent in the past but actually I'm having a weird issue about not seeing the launch agent is running. On my test machine the Google Chrome is not up to date which means the launch agent has to start in 60 seconds to use googles software update agent to identify updates but I can't see the launch agent is running with launchctl list or even on my test machine via Google Chrome which should me give a notification to update it. I got no error or something like also when I try to start the launch agent by terminal.
<key>RelaunchNotification</key>
<integer>2</integer>
<key>RelaunchNotificationPeriod</key>
<integer>3600000</integer>
That's the plist file which is stored in /Library/LaunchAgents/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.test.google.softwareupdatecheck</string>
<key>LimitLoadToSessionType</key>
<string>Aqua</string>
<key>ProgramArguments</key>
<array>
<string>/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/MacOS/GoogleSoftwareUpdateAgent</string>
<string>-runMode</string>
<string>oneshot</string>
<string>-userInitiated</string>
<string>YES</string>
<string>”$@”</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>60</integer>
</dict>
</plist>
That's the post install script
CurrentActiveUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }')
CurrentActiveUserID=$(id -u "${CurrentActiveUser}")
sudo chown root:wheel /Library/LaunchAgents/com.test.google.softwareupdatecheck.plist
sudo chmod 644 /Library/LaunchAgents/com.test.google.softwareupdatecheck.plist
sudo plutil -convert xml1 /Library/LaunchAgents/com.test.google.softwareupdatecheck.plist
echo "Loading LaunchAgent for user ${CurrentActiveUser} with ID ${CurrentActiveUserID}..."
sudo launchctl bootout gui/$CurrentActiveUserID /Library/LaunchAgents/com.test.google.softwareupdatecheck.plist
sudo launchctl bootstrap gui/$CurrentActiveUserID /Library/LaunchAgents/com.test.google.softwareupdatecheck.plist
sudo launchctl start com.test.google.softwareupdatecheck
exit 0 ## Success
exit 1 ## Failure
Anyone an idea?
