[Date Prev][Date Next]
Re: ITS#1679 gentle SIGHUP handling
I didn't apply your patch since discussion is still going on
on this subject. I had very little time to consider your ideas
about making slapd restart after a (gentle SIG)HUP; however,
before anybody goes ahead, maybe we'd better focus what's to be
Quoting a previous message of yours,
1. tell slapd to do a "gentle stop".
2. slapd enters read-only mode (i.e. rejects future update operations).
3. slapd waits for currently active update operations to finish.
4. slapd flushes the database cache, or better, closes the database
and reopens it in readonly mode (can that be done fairly simply?)
5. slapd tells the user that the database now can be backed up. (e.g.
#1 could be an ldapmodify on "cn=Control" setting "readonly=on",
and that operation would wait to finish until after step #4.)
6. you back up the database and start a new slapd with the backup.
7. you tell old slapd that it may now stop. (kill -HUP, maybe.)
8. old slapd waits for current clients to finish, and stops when they
do or after a timeout.
- we need to check whether each backend can safely turn into readonly
mode (maybe we need a dedicated API call);
- we need a means to tell slapd that another slapd is going to take
its listener(s, plus more), which might well be the SIGHUP itself;
- we need a way for the old slapd to notify that readonly mode has
been reached by the database(s);
I note that one intriguing means to do this is (as you envisaged)
to start another slapd in "overtake" mode, which takes care
of driving the old slapd in a safe status, inherits most of the
stuff the old slapd was using (I'm referring to listener(s) and
file handles in general).
Dr. Pierangelo Masarati | voice: +39 02 2399 8309
Dip. Ing. Aerospaziale | fax: +39 02 2399 8334
Politecnico di Milano | mailto:email@example.com
via La Masa 34, 20156 Milano, Italy | http://www.aero.polimi.it/~masarati