Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to run a script every time my OSX server (10.5.8) the server restarts. The closest I could find was to add the script to my login items but this would only apply to one use and I need this script to be run whenever the server restarts to matter which user logs in. Is there a way to do this?

share|improve this question
add comment

3 Answers 3

up vote 0 down vote accepted

System startup on OS X is managed by launchd. See http://en.wikipedia.org/wiki/Launchd, in particular the "External links" section. Several of these documents describe how to set up launchd services.

share|improve this answer
add comment

larsks is right, launchd is the way to do this. For a GUI to interact with launchd, check out Lingon -- it works fine on 10.5 and is fairly user friendly.

share|improve this answer
add comment

You can setup a cronjob that runs at reboot. Just use the alias @reboot instead of the normal time specification. See man 5 crontab for more info.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.