I am using UPSTART to restart my executable if by any chance it goes down and it works fine.
start on runlevel [2345]
stop on runlevel [016]
chdir /opt/data/data_server
respawn
post-stop script
sleep 30
end script
limit nofile 8092 8092
setuid david
exec ./data_server --file=../config/property.init --data_port=8080
Is there any way we can add another feature which is to send out an email (as my program went down and going to be restarted) if my executable goes down and then restart it in the same UPSTART config? I am not sure whether there is any way to do that using the same UPSTART config.
I want to send an email from [email protected] to [email protected] with a simple message that my program went down at this time and also as soon as my program is restarted then I want to send another email that my program got restarted at this time.