Skip to content

Commit

Permalink
[dist] Version bump.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Nov 15, 2010
1 parent 04705ed commit 0d5a789
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion bin/forever
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down

0 comments on commit 0d5a789

Please sign in to comment.