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

pm2 doesn't add username on the startup command in some circumstances #5498

Open
rafiibrahim8 opened this issue Dec 12, 2022 · 0 comments
Open

Comments

@rafiibrahim8
Copy link

What's going wrong?

pm2 doesn't add usernames on the startup command in some circumstances. Like this:

sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u  --hp /home/lpu

there should be a username after -u. But it is missing here. This could lead to an incorrect init system file generated when a user runs commands like the above.

Here is a screenshot:

Screenshot_20221213_034231
Here, I'm on the /home/ibra. User lpu doesn't have access to this directory. If I run pm2 startup here. It will cause this issue.

How could we reproduce this issue?

Tried on Ubuntu 22.04

  1. Go to your home directory
  2. Create a new user (a different user than your current user)
  3. Change user using su
  4. Run pm2 startup (without changing the directory)

Supporting information

Not required

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