LaunchDaemon plist file cannot run script due to permission issue

Hi,

I've created persistent task from type launchDaemon based on bash script that should run one time upon first load.

These are the contents of the plist file :

<?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.blabla.task</string>
        <key>RunAtLoad</key>
        <true/>
        <key>LaunchOnlyOnce</key>
        <true/>
        <key>Program</key>
        <string>/Library/Application\ Support/myComp /script.sh</string>
</dict>
</plist>

However, when i load the plist using launchCtl, nothing happens and no meaningful log appears...

However, when the Program location changes to /tmp/script.sh then everything is working great

So i conclude that there's permission issue to access Library/Application\ Support, although the file permission is allow for all -rwxrwxrwx.

But when I give back full disk access in privacy setting, it's working from the /Library.. path.

My question is why does bash launchd task that runs with privileges, also requires this privacy acknowledge in order to run the script?

The Program argument does not need to be escaped.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

LaunchDaemon plist file cannot run script due to permission issue
 
 
Q