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)?


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.


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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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