That's true. I have some changes and this function returns always.
In my post_config handler function I have following code:
if(!ap_graceful_stop_signalled())
{
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0,
base_server, "!!! Graceful has not been called therefor kill all sessions
!!!");
udsc_usmw_killsessions(base_server);
}
Unfortunatelly it does not work.
Best regards
Petr
2009/8/4 Graham Dumpleton <[email protected]>
> 2009/8/4 Graham Dumpleton <[email protected]>:
> > 2009/8/4 Ruediger Pluem <[email protected]>:
> >>
> >>
> >> On 08/04/2009 09:02 AM, Graham Dumpleton wrote:
> >>> 2009/8/4 Petr Hracek <[email protected]>:
> >>>> I have found in following link: (
> http://wiki.apache.org/httpd/ModuleLife)
> >>>>
> >>>> Race conditions during graceful restart
> >>>>
> >>>> During a graceful restart, old children are still serving old requests
> while
> >>>> new children are serving new requests. If the same lock must be used
> by old
> >>>> and new children, then the lock name must be the same and cannot be
> >>>> generated with tmpnam() or similar functions in the post_config hook.
> >>>>
> >>>> Which lock is means there. I have already found the in the post_config
> I
> >>>> have cleanuped procedure, but in the post_config is already mentioned
> >>>> function for killing all session.
> >>>> Is there any way how to detect if the restart of apache has been done
> as
> >>>> gracefull or as hard restart?
> >>>
> >>> /**
> >>> * predicate indicating if a graceful stop has been requested ...
> >>> * used by the connection loop
> >>> * @return 1 if a graceful stop has been requested, 0 otherwise
> >>> * @deffunc int ap_graceful_stop_signalled(*void)
> >>> */
> >>> AP_DECLARE(int) ap_graceful_stop_signalled(void);
> >>
> >> Is this also true for graceful restarts?
> >> The comment only talks about graceful stops.
> >
> > Hmmm, I presumed that the server child process wouldn't know the
> > difference and that 'stop' here meant 'stop' of an individual process
> > and not the server as a whole. I guess a bit of digging through code
> > is necessary to verify what actually happens.
> >
> > I could also possibly be wrong in assuming they were wanting to know
> > about detecting in a server child process and not Apache parent
> > process. I haven't exactly been following the discussion in detail.
>
> In prefork that function returns false all the time anyway. :-(
>
> Graham
>