-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathnode-upstart.conf
More file actions
27 lines (21 loc) · 966 Bytes
/
node-upstart.conf
File metadata and controls
27 lines (21 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# node-upstart - Example Upstart job definition for a node.js based app
#
description "Example Upstart job definition for a node.js based app"
author "Chris Verwymeren"
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [06]
# Prepare the environment
# Create directories for logging and process management
# Change ownership to the user running the process
pre-start script
# mkdir -p /var/opt/node # DRY -p would create 'node', when it creates 'log' below, if either do not exist
mkdir -p /var/opt/node/log
mkdir -p /var/opt/node/run
chown -R node:node /var/opt/node
end script
# If the process quits unexpectadly trigger a respawn
respawn
# Start the process
exec start-stop-daemon --start --chuid node --make-pidfile --pidfile /var/opt/node/run/node-upstart.pid --exec /home/node/local/node/bin/node -- /home/node/apps/node-upstart.js >> /var/opt/node/log/node-upstart.log 2>&1