-
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
User's group ids miss when the app start by pm2 #2957
Comments
Can't reproduce on ubuntu 16.04 with latest pm2 version and node 7/8, could you try on another machine ? |
@vmarchaud Thank you for your reply . I will test it on more machine at tomorrow morning .
|
Can't reproduce on MacOS Sierra 10.12.4 (16E195) PM2 | App name:index id:1 online |
On another CentOS machine , it reproduced. [front@iZm5ef6h0o28ajba4un2r2Z ~]$ id result
[front@iZm5ef6h0o28ajba4un2r2Z ~]$ uname -a |
Maybe it's coming from Centos ? |
Maybe , but not sure. I'll dig into the source code later. See if there are any solutions. |
By the way , forever (https://github.com/foreverjs/forever) works well. |
I'm having this issue on Ubuntu 16.04. running: |
This may be due to the running process Master being in resident memory and launched from a shell that did not have those group privileges. Stop all processes and do a pm2 kill and relaunch the Master pm2 process. |
@unixmonster I killed all pm2 processes and tried the same command |
FWIW I solved this issue using the initgroups method:
but you need to be root for this |
@valette I was considering putting |
maybe this could be optional? Something like |
@valette I changed my mind. If you're starting a process as a particular user, then you should be expecting that process to have all of the rights of that user, including its groups. |
Hi, it seems that commit ccb35ef broke this feature, by removing the call to initgroups. Looking at the code, it seems more complicated to fix this. |
pm2@3.1.3 seems to be the last working version. |
…ech#2938 Unitech#971 Select application uid/gid via --uid --gid (CLI+JSON) + pm2 install --uid / --gid
Hi. Issue still exists in pm2 4.2.1.
System: Linux 3.16.0-10-amd64 #1 SMP Debian 3.16.81-1 (2020-01-17) x86_64 GNU/Linux |
I had the issue and this solved it. Basically, if you modify users / groups while PM2 is already running, it won't see the changes before you restart it (the process manager, not your process in PM2). Can be done easily & safely with:
It will save your current processes, kill everything and resurrect them all. |
I can confirm this error in pm2 4.2.3 pm2 can't change group at application and the application cannot write logs to the directory in which the group has write permissions.
How reproduce:
|
|
Operation not permitted on call setgid, fix: #2957
published in pm2@4.5.0 npm install pm2@latest -g |
What's going wrong?
User's group ids miss when the app start by pm2
How could we reproduce this issue?
1 A user which has multiple groups, for example , garen in (garen, webdev, hxzhao).
2 A test script
3 when I run it by
node index.js
directly , it works well4 then I run it by pm2
the output is :
summary
Groups missing cause permissions loss, for example , in above test script , I cannot exec
nginx -t
, becausenginx
belong to the groupwebdev
.Supporting information
The text was updated successfully, but these errors were encountered: