httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ade Lee <>
Subject [users@httpd] API call to terminate server?
Date Fri, 05 Feb 2010 18:40:20 GMT

How I might terminate an apache process from from one of the child
processes? (apache 2.x)

That is - is there a C API call (ap_* ?) that I can call to ask the
parent process to terminate (and thereby also terminate the other
children too)?  

The context of this is that I have a requirement to terminate the server
if writes to an audit log fail (if the partition is full for instance).

I could make a system() call to "httpd -f httpd.conf -k stop", but it
would be nicer to do it with the appropriate API call(s).

As an aside, I did try to send a SIGTERM signal to the parent using: 

if (kill(getppid(), SIGTERM)<0) {
    last_err = errno;
    m_audit_log->get_context()->LogError( "RA::AuditThis",
        "AuditThis: Failure to send signal.  Error: %d : %s",
                       last_err, strerror(last_err));

and got "Error: 1 : Operation not permitted".

Ade Lee

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