VMware Cloud Community
mik_rose
Contributor
Contributor

OSX Agent Automatic startup

Hi again,

The windows agent has the ability of inserting it as a service. Is there any suggestions on an appropriate /System/Library/StartupItems/ script?

Mik
0 Kudos
6 Replies
admin
Immortal
Immortal

mik_rose,

If you're using OSX 10.4 or newer, you should use launchd:
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/launchd.8.html#//apple_ref/d...

If you're on 10.3 or older, or just want to use StartupItem to be old skool:
http://www.macdevcenter.com/pub/a/mac/2003/10/21/startup.html

--jeremy
0 Kudos
mik_rose
Contributor
Contributor

Thanks Jeremy.
0 Kudos
mik_rose
Contributor
Contributor

So I would assume that running this command will add it to the start-up list?
launchd /usr/local/hyperic-hq-agent-3.2.4/hq-agent.sh start
0 Kudos
mik_rose
Contributor
Contributor

lol, nm i need to not be so lazy
launchd: [-d] [-- command [args ...]]
-d daemonize
-h this usage statement

PowerXProd1:~ root# launchd -d /usr/local/hyperic-hq-agent-3.2.4/hq-agent.sh start
0 Kudos
admin
Immortal
Immortal

You can use launchctl to load and unload, but you still need a property list. I've not done this myself, so I'm sorry to keep posting you links, but this one seems easier to follow than the Apple developer links I sent before:

http://www.macgeekery.com/tips/all_about_launchd_items_and_how_to_make_one_yourself

Let me know if that helps.

--jeremy
0 Kudos
admin
Immortal
Immortal

Ahhh, perfect.
0 Kudos