Hi Ryan,

I'm attaching a patch for this which includes the override file.
Do you think this patch can be adopted in Debian until we have the
native service file? Please let me know if you think it needs any
changes!

Thanks,
Heitor
From 84316f458fb14592085f7e67d6aab349aaa312ff Mon Sep 17 00:00:00 2001
From: Heitor Alves de Siqueira <hal...@canonical.com>
Date: Mon, 6 May 2019 10:17:31 -0300
Subject: [PATCH] slapd: Fix systemd not detecting service failures

If the slapd daemon process exits due to some failure, the systemd
service is still reported as active even though the child (daemon)
process has exited with a signal. This is due to the sysv-generator unit
file for slapd telling the service to remain active after its process
exits.

This patch adds a systemd override file with 'RemainAfterExit=no', to
make the service behave in the expected way.

Closes: #926657

Signed-off-by: Heitor Alves de Siqueira <hal...@canonical.com>
---
 debian/slapd-remain-after-exit.conf | 3 +++
 debian/slapd.install                | 1 +
 2 files changed, 4 insertions(+)
 create mode 100644 debian/slapd-remain-after-exit.conf

diff --git a/debian/slapd-remain-after-exit.conf b/debian/slapd-remain-after-exit.conf
new file mode 100644
index 000000000000..b031203eaa9f
--- /dev/null
+++ b/debian/slapd-remain-after-exit.conf
@@ -0,0 +1,3 @@
+[Service]
+Type=forking
+RemainAfterExit=no
diff --git a/debian/slapd.install b/debian/slapd.install
index 2e7c9990a53d..ea197a99bf14 100644
--- a/debian/slapd.install
+++ b/debian/slapd.install
@@ -5,6 +5,7 @@ debian/ldiftopasswd usr/share/slapd
 debian/DB_CONFIG usr/share/slapd
 debian/slapd.conf usr/share/slapd
 debian/slapd.init.ldif usr/share/slapd
+debian/slapd-remain-after-exit.conf lib/systemd/system/slapd.service.d
 
 usr/lib/ldap/back_*.so*
 usr/lib/ldap/back_*.la
-- 
2.21.0

Reply via email to