Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I know you can do monit start <name> to start an individual process (eg if I had taken it down temporarily using monit stop <name>), but is there any easy way to tell it to only start the new process if the pid in the pidfile isn't running? Or do I have to make this part of whatever script monit uses to start the process if I want that kind of behavior?

share|improve this question
    
The system's commands for managing daemons should be set up so that if you try to start something that is already running nothing happens. Is that broken for you? –  vonbrand Feb 27 '13 at 13:25
    
I've written a daemon from scratch that does not on its own take care of that, my question is do I need to, or is there some kind of system command to take care of that for me? Sorry, total newbie! –  Mohamed Hafez Feb 27 '13 at 16:46
add comment

1 Answer 1

Found the answer I was looking for: use start-stop-daemon to start and stop the daemon, and all the pidfile management, not restarting if its already running, and killing the daemon if it doesn't die on its own after sending it TERM, etc, will be taken care of according to the parameters you pass.

share|improve this answer
add comment

Your Answer

 
discard

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.