Home » Questions » Computers [ Ask a new question ]

What Linux command can I use to verify that something is in the process list?

What Linux command can I use to verify that something is in the process list?

I want to parse the output of the ps command and return true or false if a program is found. How would anyone here do this? I have access to the command line so it's open for me, no restrictions.

Asked by: Guest | Views: 332
Total answers/comments: 2
Guest [Entry]

"In the general case, you should look for your SPECIFIC process in the process list, rather than something which just happens to have the same name.

We've previously been bitten by bugs where a process with the same (or similar) name appears and breaks something (usually a monitor or start/stop script, so it's not usually vital).

Your process should write a pid file when it starts up (or before, by having a shell script write its pid in then exec your task), and then you can refer to the contents of that pid file in a subsequent shell script.

To check if a specific pid is running, kill it with ""signal 0"" - this doesn't actually send a signal just checks that it is there."
Zpfxdt [Entry]

lipitor 40mg oral <a href="https://lipiws.top/">order lipitor 40mg online cheap</a> buy generic lipitor 10mg