I'm new to upstart. The following is the upstart configuration for the myserver daemon. It works fine, but I want to execute custom commands when I issue a "stop myserver" to completely close it. start-stop-daemon just kills the pid of the daemon.
description "My server"
start on filesystem or runlevel [2345]
stop on run level [!2345]
respawn
respawn limit 3 60
env cmd="/home/ubuntu/bin/server -- --config=server_conf.py start"
exec start-stop-daemon
source
share