Linux – httpd not listed in process list although its running without any issue

linux

How to check the process status if process is running and not listed in ps or top command output.

I have started httpd(Apache) service and its working perfectly, i am able to see the webpage. But top or ps command doesn't display the httpd process.

What is the issue? I am logged in as root user.
Can we check the process status by any command if process id is not listed?

[root@ip-xx-xxx-xx-xxx /]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
top - 19:54:08 up 10 days,  5:04,  1 user,  load average: 0.00, 0.01, 0.05
Tasks:  70 total,   1 running,  69 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    617044k total,   307312k used,   309732k free,    30660k buffers
Swap:        0k total,        0k used,        0k free,   218968k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      20   0  2892 1360 1164 S  0.0  0.2   0:00.34 init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.01 kthreadd
    3 root      20   0     0    0    0 S  0.0  0.0   0:01.82 ksoftirqd/0
    4 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
    5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
    6 root      20   0     0    0    0 S  0.0  0.0   0:26.84 events/0
    7 root      20   0     0    0    0 S  0.0  0.0   0:00.00 cpuset
    8 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper
   11 root      20   0     0    0    0 S  0.0  0.0   0:00.00 netns
   12 root      20   0     0    0    0 S  0.0  0.0   0:00.00 async/mgr
   17 root      20   0     0    0    0 S  0.0  0.0   0:00.00 xenwatch
   18 root      20   0     0    0    0 S  0.0  0.0   0:00.00 xenbus
   64 root      20   0     0    0    0 S  0.0  0.0   0:02.37 sync_supers
   66 root      20   0     0    0    0 S  0.0  0.0   0:02.58 bdi-default
   67 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kintegrityd/0
   69 root      20   0     0    0    0 S  0.0  0.0   0:00.03 kblockd/0
   76 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kseriod
  184 root      20   0     0    0    0 S  0.0  0.0   0:00.16 khungtaskd
  185 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kswapd0
  186 root      25   5     0    0    0 S  0.0  0.0   0:00.00 ksmd
  238 root      20   0     0    0    0 S  0.0  0.0   0:00.00 aio/0
  241 root      20   0     0    0    0 S  0.0  0.0   0:00.00 crypto/0
  252 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khvcd
  332 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kstriped
  519 root      20   0     0    0    0 S  0.0  0.0   0:00.37 jbd2/xvda1-8
  520 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ext4-dio-unwrit
  548 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khubd
  599 root      16  -4  2504  644  352 S  0.0  0.1   0:00.02 udevd
  824 root      20   0     0    0    0 S  0.0  0.0   0:00.09 kauditd
  858 root      18  -2  2500  640  352 S  0.0  0.1   0:00.00 udevd
  859 root      18  -2  2500  636  348 S  0.0  0.1   0:00.00 udevd
  983 root      20   0  2840  760  488 S  0.0  0.1   0:00.01 dhclient
 1020 root      16  -4 10896  580  428 S  0.0  0.1   0:00.85 auditd
 1035 root      20   0 29628 1436  964 S  0.0  0.2   0:01.37 rsyslogd
 1056 dbus      20   0  2980  884  700 S  0.0  0.1   0:00.58 dbus-daemon
 1151 root      20   0  8192  888  468 S  0.0  0.1   0:00.43 sshd
 1171 ntp       20   0  5072 1368 1036 S  0.0  0.2   0:01.34 ntpd

Best Answer

I prefer to use:

pgrep -l httpd

Example:

[root@mywebserver ~]$ pgrep -l httpd
3661 httpd
3665 httpd
3673 httpd
3678 httpd
3683 httpd
3688 httpd
3694 httpd
3701 httpd
: .. more....

Counting those lines also helps me to see if the server is getting overloaded.

Related Topic