Hi All.
How do I check the working directory for example PID :1234. Is it any way to detect in through ssh command /cPanel
Thanks ya!!
Hi All.
How do I check the working directory for example PID :1234. Is it any way to detect in through ssh command /cPanel
Thanks ya!!
You can get information about a PID, including its current working directory, by looking in the corresponding subdirectory in /proc. Each running PID has its own directory in /proc. Simply use the ls command to view the contents of /proc/$PID (where $PID is replaced with an actual valid PID).
For hands-on assistance, please reference our new support information page: Where should I go for support?
cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation - Find cPanel hosting
-- Jared Ryan, Technical Analyst, cPanel Technical Support
Similarly and perhaps a bit more readable, you can get the cwd of a process using it's PID through lsof. It also will provide information about currently open (or listening) connections, sockets, and open files.
Code:lsof -p <pid>
NDCHost (ProVPS): Xen VPS / Dedicated / Co-Location
Contact us for your cPanel Licensing needs! We price match, provide better support, and take care of our customers!
Yet another way is via the "readlink" command:
# readlink /proc/`pgrep cpsrvd`/cwd
/usr/local/cpanel/base
cPResources:
- Support Options - Extra Support Options - Documentation - Mailing Lists - Latest cPanel Builds
- cPanel.net Site Search - Documentation Search - Forums Search - Forums Advanced Search
-- cPJeff - Jeff P., Technical Analyst, cPanel Technical Support - Need to submit a ticket? (click here) - Need to check on an existing ticket? (click here)
Hello all,
Thanks for all those information. It helps me
Happy new year to all ;D