Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 0 down vote accepted

System startup on OS X is managed by launchd. See, in particular the "External links" section. Several of these documents describe how to set up launchd services.

share|improve this answer

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

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

Your Answer


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.