This is my first foray into creating a daemon so bear with me if I say some noob stuff.
I wrote a test script using AppleScript. Eventually, this will be more robust and be a meeting announcer and some other notifications to start my day. Here's the script for now:
say "Hello Steve, the job has launched!"
Here's the plist:
I saved this in /Library/LaunchDaemons as local.jeeves.plist. I confirmed it is there by visually finding it and running:
launchctl list
Running
launchctl list | grep local.Jeeves
also confirmed it was there.
I confirmed the script referenced by the Program
key is in that directory. It also functions as I can run it from AppleScript
Back to the plist. I loaded it by running:
launchctl load /Library/LaunchDaemons/local.jeeves.plist
Terminal did not produce any errors.
If I run:
launchctl start local.jeeves
or
launchctl start local.Jeeves
no results. No errors but the script does not run.
So I did some digging into my system.log and found these errors:
Aug 28 15:26:17 Steves-MBP com.apple.xpc.launchd[1] (com.apple.xpc.launchd.user.domain.501.100009.Aqua): Could not read path: path = /Users/xxxxxxx/Library/LaunchDaemons/local.jeeves.plist, error = 2: No such file or directory
Aug 28 15:27:33 Steves-MBP com.apple.xpc.launchd[1] (com.apple.xpc.launchd.user.domain.501.100009.Aqua): Could not read path: path = /Users/xxxxxxxx/Library/LaunchDaemons/local.jeeves.plist, error = 2: No such file or directory
Aug 28 15:28:05 Steves-MBP com.apple.xpc.launchd[1] (local.Jeeves[14803]): Could not find and/or execute program specified by service: 13: Permission denied: /Users/xxxxxxx/Scripts/AppleScripts/testScript.scpt
Aug 28 15:28:05 Steves-MBP com.apple.xpc.launchd[1] (local.Jeeves[14803]): Service setup event to handle failure and will not launch until it fires.
Aug 28 15:28:05 Steves-MBP com.apple.xpc.launchd[1] (local.Jeeves[14803]): Service exited with abnormal code: 78
So now I know the issue, or kind of. Is this a permission to the directory issue or can't find the directory at all issue?