0

I have a RHEL7 server (no GUI) running several distinct instances of httpd (distinct PID files, not defined as services...don't ask).

Trying to build a simple script that will tell me which of my httpd instances are actually started. If I run ps -ef | grep httpd, I get a listing that looks pretty much like I want, but I get a hit for every PID, which ends up giving me several hundred results. I'd like something that would give me one line for each instance.

Any ideas ?

Felix
  • 51
  • 1
  • 1
  • 5

1 Answers1

0

Use the existing PID files, if you have them:

ps -f $(cat pidfile1 pidfile2 pidfile3 ...)
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972