description "websocket-gateway"

#start on startup
#start on runlevel [2345]
# stop on runlevel [016]
stop on stopping gateways

limit nofile 20000 20000
limit core unlimited unlimited

respawn
respawn limit 10 5

instance $N

pre-start script
    set -e
    mkdir -p /var/run/websocket-gateway
    chown websocket-gateway:websocket-gateway /var/run/websocket-gateway
end script

exec start-stop-daemon --start --chuid websocket-gateway:websocket-gateway --chdir /var/lib/websocket-gateway --exec /var/lib/websocket-gateway/script/package/upstart-run.sh $N
