Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 6cf395a370ff1a1705c02809574e2f083a156ea4 @brianc committed Nov 15, 2012
Showing with 33 additions and 0 deletions.
  1. +16 −0 README.md
  2. +17 −0 generic-node.conf
@@ -0,0 +1,16 @@
+Scripts to start and manage processes with upstart
+
+## generic-node
+
+1. copy the file into `/etc/init/<your_process_name>.conf`
+2. type `sudo initctl start <your_process_name>
+
+The script will start a node app living at `/srv/<your_process_name>/index.js`
+
+Right now you need node installed somewhere root can access it. So, you'll need to make sure this return some valid output: `sudo which node`
+
+It sets NODE_EVN=production
+
+It logs your processes stdout and stderr to `/var/log/<your_process_name>.log`
+
+That's really it. Mostly here now because I keep having to reference it on other servers I set up.
@@ -0,0 +1,17 @@
+#!upstart
+description "starts a node process based on the name of this file"
+author "Brian M. Carlson"
+
+start on filesystem and static-network-up
+stop on shutdown
+
+env NODE_ENV=production
+
+respawn
+respawn limit 10 5
+
+script
+ exec >>/var/log/$UPSTART_JOB.log 2>&1
+ echo starting\ $UPSTART_JOB\ `date`
+ node /srv/$UPSTART_JOB/.
+end script

0 comments on commit 6cf395a

Please sign in to comment.