Skip to content

Instantly share code, notes, and snippets.

View krunkosaurus's full-sized avatar

Mauvis Ledford krunkosaurus

View GitHub Profile
@inadarei
inadarei / nodedaemon.sh
Created June 24, 2011 18:40
Daemonize Node.js
#!/bin/bash
## Node.js App Launcher
## Usage: ./nodedaemon.sh /home/apps/projectname/app.js
## Baesed on: http://pastebin.com/wNJNkbjg
# name=`basename $1` # For when/if we want to use scriptname
name=`dirname $1 | xargs -0 basename` # When/if we want to use last folder name as project name
cd `dirname $1`
@peterhost
peterhost / node_debian_init.sh
Created November 25, 2010 11:41
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28