I have an app service I want to start at system startup with a plist file:
<!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.my.app.ident</string>
<key>ProgramArguments</key>
<array>
<string>/Users/me/Desktop/MyApp/App</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/Users/me/Desktop/MyApp/logfile.log</string>
<key>StandardErrorPath</key>
<string>/Users/me/Desktop/MyApp/logerr.log</string>
<key>UserName</key>
<string>me</string>
</dict>
</plist>
This has been created with
sudo chown root:wheel /Library/LaunchDaemons/com.my.app.ident.plist
and permissions
sudo chmod a+x /Library/LaunchDaemons/com.my.app.ident.plist
and then loaded:
sudo launchctl load -w /Library/LaunchDaemons/com.my.app.ident.plist
The application has permissions like:
-rwxr-xr-x 1 me staff 54755728 29 Nov 12:46 App
Which runs fine but is not starting up with the system - it just logs errors to logerr.log repeating:
Couldn't memory map the bundle file for reading.
A fatal error occured while processing application bundle
Failed to map file. open(/Users/me/Desktop/MyApp/App) failed with error 1
Failure processing application bundle.
These errors stop when the user "me" signs in and then the service starts working. I need it to work without "me" signing in.
any ideas?