-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathupstart.conf
More file actions
36 lines (29 loc) · 818 Bytes
/
upstart.conf
File metadata and controls
36 lines (29 loc) · 818 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
28
29
30
31
32
33
34
35
36
#!upstart
#
# Basic upstart script for running node.js apps as a service on ubuntu.
#
#
# If you have troubles use the command : initctl check-config
#
# To install
# sudo cp %APPLICATION%.conf /etc/init/%APPLICATION%.conf
# sudo chmod 777 /etc/init/%APPLICATION%.conf
#
description "%APPLICATION% server"
author "@garrows"
start on (local-filesystems and net-device-up IFACE!=lo)
start on starting rc
setuid node-user
setgid www-data
respawn limit 5 10
respawn
script
cd %PATH%
PORT=%NODEPORT% npm start >> /var/log/node/%APPLICATION%.log 2>&1
end script
pre-start script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/node/%APPLICATION%.log
end script
pre-stop script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/node/%APPLICATION%.log
end script