Take the 2-minute tour ×

Running "sudo serivce httpd status" shows only a single process id. The root process. However, if I use top or ps, I can see there are more process than that. Apache is in prefork mode.

Has anyone seen this behavior before from Apache2?

I'd like to understand why the status command can't find the other processes.

share|improve this question
add comment

4 Answers

up vote 1 down vote accepted

The other processess you see in your qa server are the result of the command:

pidof httpd

If you check the code for the status function in /etc/init.d/functions, you will see how these results are generated and test why you only see the parent httpd process.

I think is has to be with sudo not working for pidof, try again with the root user.

share|improve this answer
Thanks. 'pidof httpd' returns the result I expected to see. Running it as root returns the same value. –  txyoji Sep 15 '09 at 18:49
add comment

Does it matter? You're asking if apache is running. The command is telling you that it is. If you kill that process, the others will die too.

I suspect the command could find the others. It just can't be bothered.

share|improve this answer
I have an 'identical' qa version of this server, which returns a list of all the processes. Seems like it could be a symptom of a larger problem. –  txyoji Sep 15 '09 at 15:23
add comment

Apache has a single control process that is responsible for launching child processes. The processes ID you get from "service httpd status" is the PID of the control process.

share|improve this answer
add comment

I have the same result:

root@serverX:~# sudo service apache2 status
 * Apache is running (pid 2958).

As the others have said, this is the main process ID; any other processes are child processes. If you need information on these, you should install mod_status which allows for ExtendedStatus and pulling all kinds of neat information from Apache.

The details given are:

- The number of worker serving requests
- The number of idle worker
- A total number of accesses and byte count served (*)
- The time the server was started/restarted and the time it has been running for
- Averages giving the number of requests per second, the number of bytes served per second and the average number of bytes per request (*)
- The current percentage CPU used by each worker and in total by Apache (*)
- The current hosts and requests being processed (*)

share|improve this answer
Nice to know its normal on other systems too. Thanks. –  txyoji Sep 15 '09 at 18:51
add comment

Your Answer


