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

Work around an edge-case in pm2 start() #39

Merged
merged 3 commits into from
Mar 31, 2020
Merged

Work around an edge-case in pm2 start() #39

merged 3 commits into from
Mar 31, 2020

Conversation

pfrazee
Copy link
Collaborator

@pfrazee pfrazee commented Mar 31, 2020

If 'pm2' detects a space in the 'script' path, it assumes the call is something like "python foo.py". When that's the case, it transforms the call into /bin/bash -c python foo.py. Relevant pm2 code: https://github.com/Unitech/pm2/blob/24c35236f555a638e1f4c803b57d7e0769261482/lib/Common.js#L659

This creates a problem for some hyperdrive apps because they may have spaces in their install paths. (This is the case for Beaker.) The resulting call ends up being ${interpreter} /bin/bash -c ${script}, which is wrong. (To add a little more complexity, it does not do this on Windows because Windows has its own shell with its own resulting issues.)

This PR solves the issue by using /bin/bash -c correctly with our own call if not windows.

@andrewosh andrewosh merged commit 9155bb7 into master Mar 31, 2020
@andrewosh andrewosh deleted the fix-pm2-exec branch March 31, 2020 22:30
@andrewosh
Copy link
Member

Published in 1.9.2

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

Successfully merging this pull request may close these issues.

None yet

2 participants