Permalink
Browse files

[dist] Version bump.

  • Loading branch information...
1 parent 04705ed commit 0d5a7894c27bf75be7d019e4f3425712be32a403 @indexzero indexzero committed Nov 15, 2010
Showing with 30 additions and 10 deletions.
  1. +27 −7 README.md
  2. +1 −1 bin/forever
  3. +1 −1 lib/forever.js
  4. +1 −1 package.json
View
@@ -21,14 +21,32 @@ There are two distinct ways to use forever: through the command line interface,
You can use forever to run any kind of script continuously (whether it is written in node.js or not). The usage options are simple:
<pre>
- usage: forever [FILE, ...] [options]
+ usage: forever [start | stop | stopall | list] [options] SCRIPT [script options]
options:
- -m MAX Only run the specified script MAX times
- -s, --silent Run the child script silencing stdout and stderr
- -o, OUTFILE Logs stdout from child script to OUTFILE
- -e, ERRFILE Logs stderr from child script to ERRFILE
- -h, --help You're staring at it
+ start start SCRIPT as a daemon
+ stop stop the daemon SCRIPT
+ stopall stop all running forever scripts
+ list list all running forever scripts
+
+ -m MAX Only run the specified script MAX times
+ -l LOGFILE Logs the forever output to LOGFILE
+ -o OUTFILE Logs stdout from child script to OUTFILE
+ -e ERRFILE Logs stderr from child script to ERRFILE
+ -p PATH Base path for all forever related files (pid files, etc.)
+ -s, --silent Run the child script silencing stdout and stderr
+ -h, --help You're staring at it
+
+ [Long Running Process]
+ The forever process will continue to run outputting log messages to the console.
+ ex. forever -o out.log -e err.log my-script.js
+
+ [Daemon]
+ The forever process will run as a daemon which will make the target process start
+ in the background. This is extremely useful for remote starting simple node.js scripts
+ without using nohup. It is recommended to run start with -o -l, & -e.
+ ex. forever start -l forever.log -o out.log -e err.log my-daemon.js
+ forever stop my-daemon.js
</pre>
There are several samples designed to test the fault tolerance of forever. Here's a simple example:
@@ -50,7 +68,7 @@ You can also use forever from inside your own node.js code.
});
child.on('exit', this.callback);
- child.run();
+ child.start();
</pre>
### Options available when using Forever in node.js
@@ -61,6 +79,8 @@ There are several options that you should be aware of when using forever:
'max': 10, // Sets the maximum number of times a given script should run
'forever': true, // Indicates that this script should run forever
'silent': true, // Silences the output from stdout and stderr in the parent process
+ 'logfile': 'path/to/file', // Path to log output from forever process (when in daemon)
+ 'pidfile': 'path/to/file', // Path to put pid information for the process(es) started
'outfile': 'path/to/file', // Path to log output from child stdout
'errfile': 'path/to/file', // Path to log output from child stderr
}
View
@@ -89,7 +89,7 @@ forever.load(config, function () {
case 'start':
var uid = forever.randomString(16);
options.uid = uid;
- options.pidFile = 'forever' + uid + '.pid';
+ options.pidfile = 'forever' + uid + '.pid';
options.logfile = argv.l || 'forever' + uid + '.log'
forever.startDaemon(file, options);
break;
View
@@ -43,7 +43,7 @@ forever.startDaemon = function (file, options) {
fs.open(options.logfile, 'w+', function (err, fd) {
try {
daemon.start(fd);
- daemon.lock(path.join(config.root, options.pidFile));
+ daemon.lock(path.join(config.root, options.pidfile));
runner.start().save();
}
catch (ex) {
View
@@ -1,7 +1,7 @@
{
"name": "forever",
"description": "A simple CLI tool for ensuring that a given node script runs continuously (i.e. forever)",
- "version": "0.2.0",
+ "version": "0.2.5",
"author": "Charlie Robbins <charlie.robbins@gmail.com>",
"contributors": [
{ "name": "Fedor Indutny", "email": "fedor.indutny@gmail.com" }

0 comments on commit 0d5a789

Please sign in to comment.