I'm just getting into upstart so i wrote a very basic script just to print to log file called: vm-service.conf that I put in /etc/init:
description "Virtual Images"
author "Me"
start on runlevel [2345]
stop on runlevel [016]
respawn
script
echo "DEBUG: `set`" >> /tmp/vm-service.log
end script
pre-stop script
echo "DEBUG: `set`" >> /tmp/vm-service.log
end script
if I run sudo start vm-service, it outputs:
vm-service start/running, process 29034
But, when I run sudo stop vm-service, it outputs:
stop: Unknown instance
I've tried running sudo initctl reload-configuration, but i still get the error on stop.
I've looked at the cookbook but I'm probably missing something obvious.