"monit restart <service>" how do I know when it's done restarting?

Viewed 13849

Our sysadmin recently switched to using monit, and so now when I want to restart a service, I'm supposed to use "monit restart <servicename>" instead of "/etc/init.d/<servicename> restart".

However, the monit command, when successful, produces no output and returns immediately. It seems like it doesn't actually do the restart until after it's next cycle.

I'm restarting the service because I made changes to it. I don't want to test my changes against the old instance. So I need to know when the restart is complete. I also would prefer it do the restart when I tell it to, and not when it gets around to it. I don't enjoy typing "ps aux | grep <myservicename>" over and over again while I wait.

Is there a way to make monit restart my service immediately?

Is there a way to make monit, or perhaps a wrapper around monit, block until the restart is finished?

Is there a way to make monit tell me that the restart was successful, or else that it failed?

3 Answers
Related