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

forever list doesn't see other user's processes, not even with sudo #544

Closed
dandv opened this issue Mar 31, 2014 · 8 comments
Closed

forever list doesn't see other user's processes, not even with sudo #544

dandv opened this issue Mar 31, 2014 · 8 comments

Comments

@dandv
Copy link
Contributor

dandv commented Mar 31, 2014

I have a process launched by user dandv, and it shows up under forever list.

But if I run forever list while logged in as another user, it shows No forever processes running. sudo forever list shows the same. I've even tried running the command from / or from /home/dandv - same result.

@promiseofcake
Copy link

Find out where the .forever directory is. If you have trouble finding it you can force forever to output logs and then use the dandv$ forever list all to see the name of the log file, and then search for it. However, the directory probably in this case is /home/dandv/.forever. Specify it with the -p switch. So: sudo forever list -p /home/dandv/.forever, see if that works.

@aMoniker
Copy link

Ran into this as well. Does forever run on a per-user basis?

@indexzero
Copy link
Member

That's a good point. I think in 1.0 we'll move to /opt/local/.forever/ or /usr/local/.forever/ in linux

@indexzero
Copy link
Member

And we'll do this in [email protected]

@Tjatse
Copy link
Contributor

Tjatse commented Nov 8, 2014

@indexzero I don't think it will be an wise choice, per-user should be kept, and it's very helpful when the server is joint ownership.

For example tom is a system user, and jimmy is another, the forever will make a distinction between tom and jimmy, 'Cause they have different root:

  • jimmy is /User/jimmy/.forever
  • tom is /User/tom/.forever

The basic reason is that they grep processes by reading socket path from /User/jimmy/.forever/sock and /User/tom/.forever/sock, of course, they can not see others processes.

Actually tom don't like jimmy catching sight of what him is running, this seems great.

How about jimmy and tom wanna share forever with other, you just need to do a simple thing:
login with root, run

$ vi /etc/profile

Then add a new line:

export FOREVER_ROOT=/opt/local/.forever

When you login with tom or jimmy, try forever [cmd], you'l notice that it is shared between each other, both tom and jimmy could see the same forever list, yap, because the pids, socks, logs are stored in a same directory (/opt/local/.forever) right now.

pm2 could see others processes is due to it memorize processes in a RPC/IPC server, if you kill the RPC server by pid, you'l find that all processes will be lost, but forever will not, forever is based on SOCKET PATH

I've test this on my CENTOS with two different users, and all have been passed, if you have any problem, I am here glad to help.

If Write permission is denied on the socket file, an EACCES exception will be caught, reference this connect(2), you need to do one more thing:

$ chmod -R 777 /opt/local/.forever

@jasonswearingen
Copy link

i had this issue, Here is my resolution.

I am running forever via crontab @reboot on a non-admin account called serviceaccount

I could not see forever when logging into that non-admin account via sudo -u serviceaccount bash

but once i used su serviceaccount I was able to use forever list no problem

@Gerst20051
Copy link

👍 doing su root i was able to see the running forever processes using forever list

@indexzero
Copy link
Member

Duplicate of #415.

@foreversd foreversd locked and limited conversation to collaborators Dec 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants