Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 have launchd configured to run a script. This works fine for the user who installed it (me), but it relaunches the script every time I log in, while I'd like it to run as long as the computer is on (like a windows service).

Details - Location:



<plist version="1.0">
share|improve this question
Are you sure it's in /Library/LaunchDaemons? The behavior you describe sounds like it's in /Library/LaunchAgents instead. – Gordon Davisson Jul 15 '12 at 17:21
Yes, I loaded it with launchctl load /Library/LaunchDaemons/com.pluuserwatcher.osx.test.plist – Maxim Khesin Jul 15 '12 at 18:19
up vote 2 down vote accepted

If you load the launchd item by running launchctl load ... as a normal user, it loads it for your user launchd instance (i.e. essentially as a LaunchAgent, so it only runs within your user login sessions. To load it into the system launchd (as a proper LaunchDaemon), use sudo launchctl load ... (or just put it in /Library/LaunchDaemons and reboot).

share|improve this answer
Thanks - it appears to work! Unfortunately I can't upvote for lack of reputation points :( – Maxim Khesin Jul 16 '12 at 0:20
@MaximKhesin: Great! Since it worked, please mark this as the "accepted" answer (see the instructions here). – Gordon Davisson Jul 16 '12 at 2:00

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.