-
Notifications
You must be signed in to change notification settings - Fork 2.6k
PM2 executed from within node inherits command line arguments #941
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
Comments
I'm having the same problem too. When the parent process is run with command line args, the child processes started via Example: processes.json:
loader.js
In the above example, pm2 will start the sub process as Note, I have to use rawArgs here to workaround another pm2 bug specified here: #590 It may be worth noting that when this bug occurs,
|
@Unitech : Any ideas about this bug? |
I've confirmed this bug. Just need time to fix it. |
I've the same problem. It happens only, if the process, that calls pm2.start() is running in pm2. If I start the process, that calls pm2.start(), without pm2, everything works fine. |
+1 |
Can you try |
Issue fixed since PM2 1.1.3
|
This is a weird one. Hopefully I can explain clearly. Let's say that I run
pm2 start a.js -- 3000
and a.js callsrequire('child_process').exec('pm2 start b.js -- 4000')
then b.js will receive 3000 as it's argument instead of 4000, as expected. This is true even if a.js uses the API, e.g.pm2.start('b.js', {rawArgs: ['--', 4000]})
. The child process seems to inherit the command line arguments of the parent.The text was updated successfully, but these errors were encountered: