Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Forever.stop() killing parent process on Forever.exit() #812

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 10 additions & 8 deletions lib/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,14 @@ forever.load = function (options) {
//
// Setup the incoming options with default options.
//
options = options || {};
options.loglength = options.loglength || 100;
options.logstream = options.logstream || false;
options.root = options.root || forever.root;
options.pidPath = options.pidPath || path.join(options.root, 'pids');
options.sockPath = options.sockPath || path.join(options.root, 'sock');

options = options || {};
options.loglength = options.loglength || 100;
options.logstream = options.logstream || false;
options.root = options.root || forever.root;
options.pidPath = options.pidPath || path.join(options.root, 'pids');
options.sockPath = options.sockPath || path.join(options.root, 'sock');
options.exitOnStop = options.exitOnStop || false;

//
// If forever is initalized and the config directories are identical
// simply return without creating directories
Expand Down Expand Up @@ -315,6 +316,7 @@ forever.load = function (options) {
forever.config.set('loglength', options.loglength);
forever.config.set('logstream', options.logstream);
forever.config.set('columns', options.columns);
forever.config.set('exitOnStop', options.exitOnStop);

//
// Setup timestamp to event logger
Expand Down Expand Up @@ -516,7 +518,7 @@ forever.startServer = function () {
var worker = new forever.Worker({
monitor: monitor,
sockPath: forever.config.get('sockPath'),
exitOnStop: true
exitOnStop: forever.config.get('exitOnStop')
});

worker.start(function (err) {
Expand Down
5 changes: 3 additions & 2 deletions lib/forever/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ var Worker = exports.Worker = function (options) {
options = options || {};

this.monitor = options.monitor;
this.sockPath = options.sockPath || forever.config.get('sockPath');
this.exitOnStop = options.exitOnStop === true;
this.sockPath = options.sockPath || forever.config.get('sockPath');
this.exitOnStop = options.exitOnStop || forever.config.get('exitOnStop');


this._socket = null;
};
Expand Down