Super User is a question and answer site for computer enthusiasts and power users. 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 have several services set up in launchctl and they all start at boot and restart automatically whenever they stop for any reason. That's great so far.

But sometimes I want one of the services to quit and not restart for a while.

Is there a recommended way to do that apart from removing the service from launchctl (which also stops it immediately, which I don't want to do)?

share|improve this question
up vote 4 down vote accepted

I found a way to do it. I added the following to the plist file.

Instead of


I made it


Just setting KeepAlive to false would interfere with the job starting at all. (It was presumably waiting to be called by someone.) But KeepAlive's status can also be determined at runtime. This service now restarts automatically when it quits for no good reason (i.e. when it is killed) but not when it quits for a reason (i.e. was shut down regularly). This is what I need.

share|improve this answer

So you want to kill the process without restarting it but you don't want to kill it immediately? Does that actually make any sense to you?

No, launchd has no such feature.

share|improve this answer
You think it doesn't make sense to want to shut down a service without killing it immediately? I think it only doesn't make sense if you do not differentiate between shutting down a service and killing it. – Andrew J. Brehm Apr 3 '10 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .