Hallo everyone
I have a launchagent which works perfectly on macOS Big Sur but not on macOS Monterey. This Launchagent should trigger a script every 10 sec. Very strange. Tried everything but still no luck :-(
Here is the launchagent:
<?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.company.kerberos</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>/Library/Application Support/company/Tools/RefreshKerborosTicket.sh</string>
</array>
<key>WatchPaths</key>
<array>
<string>/etc/resolv.conf</string>
<string>/var/run/resolv.conf</string>
<string>/private/var/run/resolv.conf</string>
</array>
<key>StandardOutPath</key>
<string>/var/log/kerborostgt.log</string>
<key>StandardErrorPath</key>
<string>/var/log/errkerborostgt.log</string>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>10</integer>
</dict>
</plist>
The error that I get is:
2022-06-27 10:00:52.823197 (gui/501/com.company.kerberos [28057]) <Error>: Service could not initialize: posix_spawn(/bin/bash) error: 0xd: Permission denied
here is my troubleshooting process:
I checked the Permissions for the script and launchagent. Everything looks good there.
I executed the script manuelly in terminal. it works perfectly
I changed (/bin/bash) to "bash" and "sh" and also deleted the whole string. still getting permission denied error.
Why the permission denied? cant figure out. Has someone experienced such behavior?
The Launchagent should be working as it works on macOS Big Sur.
Thanks in advance
regards
Mehdi
PS: The launchagent and script are used to refresh the SSO Extension tickets. Source: https://community.jamf.com/t5/jamf-pro/sso-kerberos-extension-how-to-refresh-expired-tickets/m-p/251239