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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<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

1 Answer 1


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)

  • > 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. Commented Oct 16, 2013 at 12:11

You must log in to answer this question.

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