Hey, I have a server app that I need to to start when the computer runs. To start it in terminal I would type sudo ~/.bridge/server start I had a look at the docs re Daemons and Agents and wrote a .plist of my own to start the process but it does not seem to be working. This is the .plist <?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.getbridge.bridge_server</string> <key>ProgramArguments</key> <array> <string>/Users/MacbookPro/.bridge/server</string> <string>start</string> </array> <key>KeepAlive</key> <true/> <key>RunAtLoad</key> <true/> </dict> </plist> Am I doing something wrong and if I need to ask this question somewhere else then please let me know. Thanks in advance. Best Regards, Cameron Mc Gorian
On 7 Dec 2012, at 06:25, Cameron Mc Gorian <cameron@sello.me> wrote:
I have a server app that I need to to start when the computer runs. To start it in terminal I would type
sudo ~/.bridge/server start
Does this return once the server is started? If so, that's not the launchd way. Check out the list of does and don't at the top of <x-man-page://5/launchd.plist>. Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
On 7 Dec 2012, at 06:25, Cameron Mc Gorian <cameron@sello.me> wrote:
<key>ProgramArguments</key> <array> <string>/Users/MacbookPro/.bridge/server</string> <string>start</string> </array>
Also, if you're loading this job into the global launchd it's not safe to put the server in the user's home directory (because the user might replace it with their own code and thus escalate privileges without authorisation). Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
Can you suggest a directory to put it in? The server does not return once the process is started. I have managed to get this to work, there was an issue with Erlang starting up. Best Regards, Cameron Mc Gorian On Dec 12, 2012, at 1:21 PM, Quinn The Eskimo! <eskimo1@apple.com> wrote:
On 7 Dec 2012, at 06:25, Cameron Mc Gorian <cameron@sello.me> wrote:
<key>ProgramArguments</key> <array> <string>/Users/MacbookPro/.bridge/server</string> <string>start</string> </array>
Also, if you're loading this job into the global launchd it's not safe to put the server in the user's home directory (because the user might replace it with their own code and thus escalate privileges without authorisation).
Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/launchd-dev
On 12 Dec 2012, at 11:32, Cameron Mc Gorian <cameron@sello.me> wrote:
Can you suggest a directory to put it in?
The official advice on this front, as specified by <x-man-page://7/hier>, would have you put in in /usr/local. I've never been very happy with that advice because that directory isn't visible to the user. You can create your own per-product directory in /Library or put a single binary in /Library/PrivilegedHelperTools. Also, if you only deploy to new systems (I'm not sure when we made it not writeable by admin by default, but it was fairly recently) you can use /Library/Application Support. Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
participants (2)
-
Cameron Mc Gorian
-
Quinn "The Eskimo!"