Comment 7 for bug 1821343

Revision history for this message
Ryan Tandy (rtandy) wrote : Re: [Bug 1821343] [NEW] slapd process failure is not detected by systemd

Hello Hector,

On Fri, Mar 22, 2019 at 12:36:57PM -0000, Heitor R. Alves de Siqueira wrote:
>The slapd package for OpenLDAP is shipped with a SysV-style init script
>(/etc/init.d/slapd). Systemd automatically converts this to a systemd
>service by generating the unit file using the systemd-sysv-generator(8)
>utility. The generated unit file contains Type=forking and
>RemainAfterExit=yes directives.
>
>If the slapd daemon process exits due to some failure (e.g., it receives
>a SIGTERM or SIGKILL), the failure is not detected properly by systemd.
>The service is still reported as active even though the child (daemon)
>process has exited with a signal.
>
>We can easily fix this by including a proper systemd service file for
>slapd in the openldap package.

Do you need a whole service file for this? I thought you could achieve
the same with a drop-in that just overrides the required keys:

/etc/systemd/systems/slapd.service.d/remain-after-exit.conf:

[Service]
Type=forking
RemainAfterExit=no
Restart=on-failure

(untested, based on bug 1488962)