Skip to content

Instantly share code, notes, and snippets.

@Slashed
Created March 26, 2010 00:50
Show Gist options
  • Save Slashed/344334 to your computer and use it in GitHub Desktop.
Save Slashed/344334 to your computer and use it in GitHub Desktop.
var sys = require("sys");
var daemon = require("./daemon");
// Do whatever initialization stuff you need here
var pid = daemon.start(); //Returns daemons PID
daemon.closeIO(); // Closes stdin, stdout, stderr
process.umask(027); //Change umask
process.chdir("/var/myserver"); //Change working directory
// Your daemon code goes here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment