[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: Can't kill idle slapds on FreeBSD 4.0

> Assuming that the above is true, that you are _not_ running
> out of inetd, but are instead running it as a standalone
> program, then the effect of the signal handler is to set a
> global variable "slapd_shutdown" to 1.

Nope, not running out of inetd.
> Since select() is interrupted by the signal, the return
> value will be "-1" with errno set to EINTR.  The code
> does not call "siginterrupt(3)" or "sigaction(2)" to set
> the system call restart (POSIX signal semantics remain in
> effect -- unfortunately, since they make writing a threads
> library harder), so we are guarnteed that select will be
> interrupted.  This falls to case -1, which calls continue,
> which goes to the top of the while() loop, which checks
> the value of slapd_shutdown, which exits.

I'm not even sure what the POSIX signal semantics ARE, so please
forgive me if I'm being stupid here.  The siginterrupt man page
says "System call restart has been the default behaviour since
4.2BSD, and is the default behaviour for signal(3) on FreeBSD."

And if I turn all the logging on and add Debug(.."received SIGTERM"..)
to slap_set_shutdown, syslog says:

slapd[35557]: before select active_threads 0
slapd[35557]: received SIGTERM

and nothing more. The process keeps running and does NOT log
"select failed errno ..."  Sending an LDAP request to the process
wakes it up and it exits normally, so my guess is that the select
is restarting without returning an error.

> Works great on my FreeBSD 4.x box...

Are you sure your slapd is idle?  This was with OpenLDAP 1.2.10 compiled
from source with "./configure --enable-shell", if it matters.