Server Fault is a question and answer site for system and network administrators. 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 am trying to use PathState to start and stop a daemon on Mac OSX. It start when I create a file called /var/cache/myjob/run. However when the file is removed, the daemon doesn't stop again.

How do you use PathState to make it stop?

The launch configuration

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
                <true />
            <string>java -Xmx512m -XX:MaxPermSize=192m -Djava.awt.headless=true
                -Djava.endorsed.dirs=./endorsed -Dcatalina.base=./
                -Dcatalina.home=./ -cp bin/bootstrap.jar:./conf
share|improve this question
up vote 0 down vote accepted

You can't do that with a launchd item. A launchd item specifies the conditions under which a program should be started (and maybe restarted if it exits), but not the conditions under which it should be stopped. You'll need to use some other mechanism to stop the process. (Note that you can stop a running daemon with e.g. sudo launchctl stop com.clcbio.clcserver)

share|improve this answer
> If the value of the key is true, then the job will be kept alive as > long as the path exists. It will take 3-4 seconds to stop the job. No need to use launchctl stop or unload command. – Parag Bafna Oct 16 '13 at 12:11

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.