| 1 |
[Unit] |
| 2 |
Description=OpenLDAP Server Daemon |
| 3 |
After=network.target |
| 4 |
# It doesn't really need network-online. Might revisit this for trixie: |
| 5 |
# old initscript does have dependency on network-online. |
| 6 |
#After=network-online.target |
| 7 |
# For binding to particular IPs with systemd-networkd, use |
| 8 |
#After=systemd-networkd-wait-online@eth0:no-carrier.service |
| 9 |
# (with appropriate name for eth0) |
| 10 |
Documentation=man:slapd |
| 11 |
Documentation=man:slapd-config |
| 12 |
Documentation=man:slapd-mdb |
| 13 |
|
| 14 |
[Service] |
| 15 |
Type=notify |
| 16 |
# /etc/default/slapd sets: |
| 17 |
# SLAPD_SERVICES SLAPD_CONF SLAPD_USER SLAPD_GROUP SLAPD_OPTIONS |
| 18 |
# Also can set KRB5_KTNAME |
| 19 |
EnvironmentFile=/etc/default/slapd |
| 20 |
# can use User=, but it does not accept $Variables (compatibility) |
| 21 |
# can use RuntimeDirectory= but it need to be owned by user anyway |
| 22 |
ExecStart=sh -c 'mkdir -p /run/slapd; \ |
| 23 |
chown "$SLAPD_USER":"$SLAPD_GROUP" /run/slapd; \ |
| 24 |
[ -d "$SLAPD_CONF" ] && confflag=-F || confflag=-f; \ |
| 25 |
exec /usr/sbin/slapd -d0 \ |
| 26 |
${SLAPD_SERVICES:+-h "$SLAPD_SERVICES"} \ |
| 27 |
${SLAPD_USER:+-u "$SLAPD_USER"} \ |
| 28 |
${SLAPD_GROUP:+-g "$SLAPD_GROUP"} \ |
| 29 |
${SLAPD_CONF:+$confflag "$SLAPD_CONF"} \ |
| 30 |
$SLAPD_OPTIONS' |
| 31 |
|
| 32 |
[Install] |
| 33 |
WantedBy=multi-user.target |