diff --git a/doc/man/man5/slapd.conf.5 b/doc/man/man5/slapd.conf.5
index 6bae0f6bc93b78c9dcd60c6d58a8a86366ee514c..185ef1a1de8dea296a3130aec48d454c39ff1eae 100644
--- a/doc/man/man5/slapd.conf.5
+++ b/doc/man/man5/slapd.conf.5
@@ -208,7 +208,8 @@ disables StartTLS if authenticated (see also
 A SIGHUP signal will only cause a 'gentle' shutdown-attempt:
 .B Slapd
 will stop listening for new connections, but will not close the
-connections to the current clients.  It terminates when all clients
+connections to the current clients.  Future write operations return
+unwilling-to-perform, though.  Slapd terminates when all clients
 have closed their connections (if they ever do), or \- as before \-
 if it receives a SIGTERM signal.  This can be useful if you wish to
 terminate the server and start a new
diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c
index 137734c104b8d3a3d2fb8557cd4d137c911d21e1..80de649bea208adccf645b2ac580e0e00bb2ee10 100644
--- a/servers/slapd/daemon.c
+++ b/servers/slapd/daemon.c
@@ -237,7 +237,7 @@ void slapd_remove(ber_socket_t s, int wake) {
 	FD_CLR( s, &slap_daemon.sd_writers );
 
 	ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
-	WAKE_LISTENER(wake || slapd_gentle_shutdown < 0);
+	WAKE_LISTENER(wake || slapd_gentle_shutdown == 2);
 }
 
 void slapd_clr_write(ber_socket_t s, int wake) {
@@ -1114,17 +1114,18 @@ slapd_daemon_task(
 		if( slapd_gentle_shutdown ) {
 			ber_socket_t active;
 
-			if( slapd_gentle_shutdown > 0 ) {
+			if( slapd_gentle_shutdown == 1 ) {
 				Debug( LDAP_DEBUG_ANY, "slapd gentle shutdown\n", 0, 0, 0 );
 				close_listeners( 1 );
-				slapd_gentle_shutdown = -1;
+				global_restrictops |= SLAP_RESTRICT_OP_WRITES;
+				slapd_gentle_shutdown = 2;
 			}
 
 			ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
 			active = slap_daemon.sd_nactives;
 			ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
 			if( active == 0 ) {
-				slapd_shutdown = -1;
+				slapd_shutdown = 2;
 				break;
 			}
 		}
@@ -1780,7 +1781,7 @@ slapd_daemon_task(
 #endif
 	}
 
-	if( slapd_gentle_shutdown >= 0 )
+	if( slapd_gentle_shutdown != 2 )
 		close_listeners ( 0 );
 	free ( slap_listeners );
 	slap_listeners = NULL;