-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupstart.conf
47 lines (41 loc) · 1.95 KB
/
upstart.conf
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
37
38
39
40
41
42
43
44
45
46
47
# upstart service file at /etc/init/fancytree.conf
description "Meteor.js (NodeJS) application"
author "Titov Anton <[email protected]>"
# When to start the service
start on started mongodb and runlevel [2345]
# When to stop the service
stop on shutdown
# Automatically restart process if crashed
respawn
respawn limit 10 5
# we don't use buil-in log because we use a script below
# console log
# drop root proviliges and switch to mymetorapp user
setuid fancytree
setgid fancytree
script
export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
# set to home directory of the user Meteor will be running as
export PWD=/home/fancytree
export HOME=/home/fancytree
# leave as 127.0.0.1 for security
export BIND_IP=127.0.0.1
# the port nginx is proxying requests to
export PORT=3000
# this allows Meteor to figure out correct IP address of visitors
export HTTP_FORWARDED_COUNT=1
# MongoDB connection string using fancytree as database name
export MONGO_URL=mongodb://localhost:27017/fancytree
# The domain name as configured previously as server_name in nginx
export ROOT_URL=https://fancytree.titovanton.com
# optional JSON config - the contents of file specified by passing "--settings" parameter to meteor command in development mode
# export METEOR_SETTINGS='{ "somesetting": "someval", "public": { "othersetting": "anothervalue" } }'
# this is optional: http://docs.meteor.com/#email
# commented out will default to no email being sent
# you must register with MailGun to have a username and password there
# export MAIL_URL=smtp://[email protected]:[email protected]
# alternatively install "apt-get install default-mta" and uncomment:
# export MAIL_URL=smtp://localhost
exec node /fancytree/bundle/main.js >> /fancytree/fancytree.log
end script