httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <>
Subject RE: [users@httpd] shutting down apache from a 'C' program
Date Mon, 21 May 2007 10:54:34 GMT
> -----Original Message-----
> From: 
> [] 
> Sent: Monday, May 21, 2007 7:47 AM
> To:
> Subject: [users@httpd] shutting down apache from a 'C' program
> Hi,
> We are trying to shutdown apache server through a 'C' program.

Won't even ask why...

> We tried calling system("httpd -k stop").
> Also we tried to spawn a child process and replace using exec 
> with the "<server-root>/bin/httpd","-k","stop").
> But none of them worked.

This is some version of unix or linux, I guess? Basically, you need to
get the process-id of the parent apache process (see PidFile directive
in the config) and send it a kill signal. Eg,

kill `cat /path/to/apache/server/root/logs/`

NB1 - this needs to be the user who started apache (possibly root?)

Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> I am unable to understand the 
> dynamics of apache processes are being run so that i can shut 
> down the apache server gracefully through the program.i tried 
> using ap_graceful_stop_signalled().But it also didn't work in 
> our case.Any help please!Any one has done this before and 
> succeeded too?Thankyou in advance
> The information contained in this electronic message and any 
> attachments to this message are intended for the exclusive 
> use of the addressee(s) and may contain proprietary, 
> confidential or privileged information. If you are not the 
> intended recipient, you should not disseminate, distribute or 
> copy this e-mail. Please notify the sender immediately and 
> destroy all copies of this message and any attachments. 
> WARNING: Computer viruses can be transmitted via email. The 
> recipient should check this email and any attachments for the 
> presence of viruses. The company accepts no liability for any 
> damage caused by any virus transmitted by this email.
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message