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?
Asked
Active
Viewed 191 times
1
![](../../users/profiles/162020.webp)
Mohamed Hafez
- 151
- 8
-
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
1 Answers
0
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.
![](../../users/profiles/162020.webp)
Mohamed Hafez
- 151
- 8