-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Unable to use startup with another user than root #789
Comments
I've got a similar problem. I am using CentOS 6.5 and need to run my apps with When I setup
My previous setup was the following: Another option is to run So, as far as I understand, the only remaining option is to run Maybe I missing something? |
Those are my recommendations to run pm2 with a user that's not root:
The user will have it's own pm2 instance. I usually put nginx on top of pm2 and set an upstream to the app port. About |
The problem is that pm2 cannot successfully start when configured with |
Just change the user home directory. |
soyuka the startup script does'nt work with any other users than root. Even if you set a home directory fot this user. |
I just set up a vagrant box with pm2 and a
worked. |
#837 related |
Closing as #831 duplicate |
Sorry for late question, but after reading this I can't understand is it possible to run my process as Because currently I'm running my nodejs as root and this is too bad :( |
Another possible solution is this, inside your NodeJS script you run...
|
Hello, first thanks for your amazing tool.
After having read many thread I'm still having one problem.
I guess it's not so safe tu start js process with root user (tell me if I'm wrong). So I would like to run them with for exemple www-data.
Well I did these tricks:
pm2 startup ubuntu -u www-data
The startup script is well created with correct user but when my server restart, pm2 doesn't. Inside boot log I can see an error like "no directory, ... using HOME=/ ...". When I startup with root I don't have this error and pm2 start fine. Anyway when I'm using another user for the startup than root, it doesn't start at all.
Maybe I'm wrong, and it's normal to run pm2 with root. I'm very new in server configuration and I just want to make things right and run my node.js app with correct privileges.
Thanks in advance.
The text was updated successfully, but these errors were encountered: