Hi,
I have experienced strange behavior from launchd on macOS Ventura. The scenarios are following:
If a .plist is copied to /Library/LaunchAgents then:
- it loads for normal user
- it does not load for guest user
If a .plist is a symlink to a .plist inside app bundle, it loads in both cases.
Following are the launchd logs from the scenario when it does not load:
2022-07-21 16:04:29.403496 (gui/201/com.avast.userinit [4556]) <Error>: Service could not initialize: Untrusted spawn was denied for /Library/LaunchAgents/com.avast.userinit.plist, error 0xa1 - Service cannot be launched because of BTM policy
2022-07-21 16:04:29.403513 (gui/201/com.avast.userinit [4556]) <Error>: initialization failure: 22A5295i: xpcproxy + 21944 [418][B19C1C8C-E684-388B-857E-802288C1D9C3]: 0xa1
2022-07-21 16:04:29.403520 (gui/201/com.avast.userinit [4556]) <Error>: Untrusted service was denied launch by BTM. Removing.
2022-07-21 16:04:29.403523 (gui/201/com.avast.userinit [4556]) <Notice>: internal event: INIT, code = 161
2022-07-21 16:04:29.404265 (gui/201/com.avast.userinit [4556]) <Notice>: xpcproxy exited due to exit(78)
2022-07-21 16:04:29.404272 (gui/201/com.avast.userinit [4556]) <Notice>: exited due to exit(78)
Is this a bug in launchd? Or is it now preferred to use symlinks so the OS can figure out to what bundle the .plist belongs.
If similar policy will later be applied also to non-guest users or for plists inside /Library/LaunchDemons, it will break our application.
Thanks for any info on this.