pm2 startup as non root does not consider --hp argument
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
What's going wrong?
When pm2 startup -u user --hp /opt/user is not run as root, it generates a command that should be executed via sudo. That command, however, is generated with process.env.HOME instead of the actual argument of --hp.
How could we reproduce this issue?
Just execute
pm2 startup -u user --hp /opt/user
it will show command with --hp of executing user.
Supporting information
pm2 5.4.2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the pm2 startup -u user --hp /opt/user CLI entry point and inspect how the sudo command is generated when startup is run as a non-root user. Reproduce the command and verify that the generated --hp value preserves /opt/user rather than the executing user's HOME.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100