How to know cmdline for a pid. (no ps, no top, no /proc)
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Red hat, Solaris, AIX, HP-UX, FreeBSD
Posts: 15
Rep:
How to know cmdline for a pid. (no ps, no top, no /proc)
Hi all !!!
A few days ago i had to deal with a very odd situation.
Ps hanged. Top hanged. i discovered a pid which seems to block the execution of this commands.
I needed to know which was the process behind that pid. But when trying to access /proc/$pid/ session hanged.
I suppose this problem to access /proc/$pid cause the hang of the other commands (ps,top, etc)
How can i know info about a pid if i can't access data on /proc ?
Userland processes depend on /proc being available. If you know what to look for a 'grep -a {someSearchTerm} /proc/[0-9]*/cmdline' can give you info. But obviously no realtime process stats unless you query the other related proc/{pid}/* entries. If you want to troubleshoot the issue here then listing (if relevant) HW specs, kernel version, applications, knowing which changes were made before this behaviour appeared and checking system and daemon logs and posting exact error messages may help.
'grep -a {someSearchTerm} /proc/[0-9]*/cmdline' would hang the session. because every command trying to read data on /proc/$pid was hanging.
You know that for a fact because:
- you straced your "ps,top, etc" commands previously to show blocked syscalls?
- you actually tried grep and the strace shows the reasons why it wouldn't work?
If so posting strace results may be interesting. If you didn't: bummer. No "evidence". Regardless I think you should try to find out what changed on the system that causes hangs.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.