Skip to content

Commit

Permalink
forever.pidFilePath implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdecker committed Feb 28, 2011
1 parent e9b2cd3 commit 52184ae
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ forever.start = function (script, options) {
//
forever.startDaemon = function (script, options) {
options.logFile = forever.logFilePath(options.logFile);
options.pidFile = path.join(config.pidPath, options.pidFile);
options.pidFile = forever.pidFilePath(options.pidFile);
var runner = new forever.Monitor(script, options);

daemon.daemonize(options.logFile, options.pidFile, function (err, pid) {
Expand Down Expand Up @@ -400,6 +400,19 @@ forever.logFilePath = function(logFile) {
}
};

//
// ### function pidFilePath (pidFile)
// #### @logFile {string} Pid file path
// Determines the full pid file path name
//
forever.pidFilePath = function(pidFile) {
if (pidFile && pidFile[0] === "/") {
return pidFile;
} else {
return path.join(config.pidPath, pidFile);
}
};

//
// ### function checkProcess (pid, callback)
// #### @pid {string} pid of the process to check
Expand Down

0 comments on commit 52184ae

Please sign in to comment.