[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: restart command for monit?
From: |
mjimenez |
Subject: |
Re: restart command for monit? |
Date: |
Wed, 16 Mar 2011 14:32:49 +0100 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
Hi
On Wed, Mar 16, 2011 at 05:51:42AM -0700, Adam Beguelin wrote:
> Monit supports commands like:
>
> start program = "/etc/init.d/crazyd start"
>
> But it doesn't support:
>
> restart program = "/etc/init.d/crazyd restart"
>
> I have a daemon that expects a restart command so it can gracefully shut down
> the running process, then start a new one. Restarting via start/stop doesn't
> do the right thing since it starts a new daemon while the old one is still
> running.
>
> Any suggestions on how to get around this?
>
> Regards,
> Adam
>
Excuse me if I don't understand the scenario but, are you sure that monit is
the rigth tool for this task?
This "restart procedure" that the daemon needs, is associated with a
failure condition of the daemon, to be managed by monit?
(Looks like a faulty daemon)
Anyway, you are free to define the stop/start monit programs, maybe you can
write two scripts for the tasks
- /home/adam/adam-stop: performs a '/etc/init.d/crazyd restart'
- /home/adam/adam-start: does nothing
Or maybe you can use a rule like
... then exec '/home/adam/custom-restart.sh'
Regards
M.