I want to restart a process monitored by monit, when the checksum of a file failed. Currently i use
check process prosody with pidfile /var/run/prosody/prosody.pid
depends certificate_file
start program "/etc/init.d/prosody start"
stop program "/etc/init.d/prosody stop"
restart program "/etc/init.d/prosody restart"
check file certificate_file with path /etc/prosody/certs/fullchain.pem
if changed checksum then exec "/usr/bin/monit restart prosody"
But i would like to have some command like if changed checksum then restart prosody
instead of using the monit binary via exec
.
The restart
action seems to be limited to restart the currently monitored process, so an action in a check file
block doesn't do anything.