I've got a super simple test node server
# server.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8080, '127.0.0.1');
console.log('Server running at http://127.0.0.1:8080/');
I've got a simple upstart script, /etc/init/myapp.conf
description "myapp"
author "me"
start on started
stop on shutdown
exec /usr/bin/node /path/to/server.js
starting works great
sudo start myapp
myapp start/running, process 2518
But stopping just respawns the app
sudo stop myapp
myapp start/running, process 2527
What am I not getting?
PS: I'm using ubuntu 14.04