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

Forever failling on process.cwd() *after* the primary forever process quits #694

Open
fresheneesz opened this issue Mar 26, 2015 · 1 comment

Comments

@fresheneesz
Copy link

I have a situation where I have an installer script that unpacks itself into a temporary directory, executes a node script within that temporary directory which starts a few things using forever, then once everything is done, the temp directory is destroyed.

I'm seeing this error after the forever daemonizer process quits:

/root/tixit/forwarder/node_modules/forever/node_modules/nconf/lib/nconf/stores/file.js:31
  this.dir    = options.dir    || process.cwd();
                                          ^
Error: ENOENT, no such file or directory
    at new exports.File (/root/tixit/forwarder/node_modules/forever/node_modules/nconf/lib/nconf/stores/file.js:31:43)
    at Object.<anonymous> (/root/tixit/forwarder/node_modules/forever/lib/forever.js:53:24)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/root/tixit/forwarder/node_modules/forever/bin/monitor:3:15)
    at Module._compile (module.js:456:26)

The script should be capturing the working directory before it exists, and it should pass it to its children. Those scripts should never have to call process.cwd() because otherwise things like this can happen.

@fresheneesz
Copy link
Author

I tried setting the working directory explicitly with --workingDir but it didn't help. I'll just have to set the working directory when i spawn forever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant