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

Wrong pm2.pid path #48

Open
rlio opened this issue Nov 16, 2020 · 0 comments
Open

Wrong pm2.pid path #48

rlio opened this issue Nov 16, 2020 · 0 comments

Comments

@rlio
Copy link

rlio commented Nov 16, 2020

Hi
the code inside the PM2Tracker.js get the wrong pm2.pid path.
Using var PM2_HOME = process.env.HOME + '/' + (process.env.PM2_HOME || '.pm2');,
the code prepend the user home directory to the PM2_HOME environment variable and according to the code on node_modules/pm2/paths.js

I think can be useful modify the code like this
if (process.env.PM2_HOME) PM2_HOME = process.env.PM2_HOME; else if (process.env.HOME && !process.env.HOMEPATH) PM2_HOME = p.resolve(process.env.HOME, '.pm2'); else if (process.env.HOME || process.env.HOMEPATH) PM2_HOME = p.resolve(process.env.HOMEDRIVE, process.env.HOME || process.env.HOMEPATH, '.pm2'); else { console.error('[PM2][Initialization] Environment variable HOME (Linux) or HOMEPATH (Windows) are not set!'); console.error('[PM2][Initialization] Defaulting to /etc/.pm2'); PM2_ROOT_PATH = p.resolve('/etc', '.pm2'); }

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