Bug 31998 - Shutdown slapd via kill HUP
Shutdown slapd via kill HUP
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 3.1
Other Linux
: P5 enhancement (vote)
: UCS 3.2
Assigned To: Arvid Requate
Felix Botner
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-17 14:16 CEST by Stefan Gohmann
Modified: 2013-11-19 06:44 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2013-07-17 14:16:21 CEST
From http://www.openldap.org/lists/openldap-software/200407/msg00624.html:

Slapd interprets HUP as a "gentle" shutdown, i.e.
it waits for all connections to close before shutting down.

We should be able to send the slapd such a graceful restart which uses kill HUP.
Comment 1 Arvid Requate univentionstaff 2013-07-17 15:15:34 CEST
The init script now supports "graceful-restart" and "graceful-stop". Both ask slapd kindly to stop and then wait 120 seconds. If it did not stop by that time the process is killed. Tested with:

root@slave87:~# pkill -STOP slapd
root@slave87:~# /etc/init.d/slapd graceful-restart
Initiating graceful reload of ldap server(s).
Sending HUP to ldap server(s): slapd ...done.     ### waiting 120 seconds here
Check database: ...WARNING.
WARNING: There are stale locks in LDAP backend Berkeley DB.
WARNING: If slapd does not respond, manual LDAP dump/restore may be necessary.
Continuing BDB database check: ...done.
Starting ldap server(s): slapd ...done.
Comment 2 Felix Botner univentionstaff 2013-08-05 17:45:36 CEST
OK 
-> strace  -p $(pidof slapd) 2>&1 | grep -i Sig
--- SIGHUP (Hangup) @ 0 (0) ---
rt_sigreturn(0x2)  
-> /etc/init.d/slapd graceful-restart

-> strace  -p $(pidof slapd) 2>&1 | grep -i Sig
--- SIGHUP (Hangup) @ 0 (0) ---
rt_sigreturn(0x2)                       = 202
-> /etc/init.d/slapd graceful-stop

OK - Changelog
Comment 3 Stefan Gohmann univentionstaff 2013-11-19 06:44:00 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".