Failed to start slapd.service at start-up

What type of hardware are you using: Raspberry Pi 3, 4+
What YunoHost version are you running: 12.0.16
How are you able to access your server: Direct access via physical keyboard/screen
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: NO

Describe your issue

I switched off my raspberry to move it (sudo shutdown, I’m always careful to switch it off before unplugging it).

I plugged it back in a few minutes later, and it turned on correctly, but I realised that some services were no longer working, including Nextcloud. I try to connect to the YunoHost admin interface, but it’s impossible, no user is recognised. I try to do the same thing via SSH, same thing, impossible, even with SSH keys. No user recognised.

So I connected the raspberry to a screen and realised that the slapd service wasn’t running at start-up.

[FAILED] Failed to start slapd.service (Lightweight Directory Access Protocol).
         See ‘systemctl status slapd.service’ for details.
         Starting nslcd.service – LSB: LDAP connection daemon...

I’ve tried several different ways of connecting so that I can regenerate the LDAP config and see if I can resolve the problem, but it’s impossible. I don’t know what else to do.

Services that don’t require YunoHost LDAP work without a hitch.

Share relevant logs or error messages

root@(none):/# yunohost tools regen-conf sldap --force
Warning: The LDAP service is down, attempt to restart it
System has not been booted with systemd as init system (PID 1). Can’t operate.
Failed to connect to bus: Host is down
Info: The operation ‘Regenerate system configurations ‘sldap’’ could not be completed. Please share the full log of this operation using the command ‘yunohost log share 19700101-004751-regen_conf-sldap’ to get help
Error: Service slapd is not running but is required to perform this action
    You can try to investigate what’s happening with ‘systemctl status slapd’

I don’t know how that’s even possible … Have you been tweaking your setup or doing stuff that are kind of out of the ordinary ?

No, done nothing to my setup…

Well actually this sounds like you’ve been running this command from a rescue shell somehow so it’s expected (i think?) that systemd is not running .. Or was this from a chroot ? How did you enter that shell ?

I don’t even remember… I had a hard time a few days ago. I think I had to change cmdline.txt in /boot to add init=/bin/bash

Yes that sounds consistent with what the prompt looks like … But why not just do a regular boot and check the slapd system logs ? With systemctl slapd status ? Or the issue that you can’t even login on direct screen+keyboard after a regular boot ? What about using the root account ? (The password should be something like the very first password you chose during postinstall, or if you don’t remember it, you can indeed change it booting with init=/bin/bash and then running passwd to change it)

I actually don’t have root account because YunoHost disable it…

And no, can’t login to any account with normal boot.

root is not disabled … what is disabled is login to root using SSH from outside the local network ..

Oh ! Okay, gonna try booting to init=/bin/bash, changing password and I’ll tell you, thanks!

root@(none):/# passwd
New password: 
Retype new password:
passwd: Authentification token manipulation error
passwd: password unchanged

Okay, very weird. I changed my raspberry to another network (I’m traveling).
In the meantime, I :

mount -o remount,rw /dev/sda2 /
passwd

(password change successfull this time)
and that it is, nothing else…

Booted up and now the service runs correctly at boot…

retiolus@home:~ $ sudo systemctl status slapd.service 
[sudo] password for retiolus: 
● slapd.service - LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)
     Loaded: loaded (/etc/init.d/slapd; generated)
    Drop-In: /usr/lib/systemd/system/slapd.service.d
             └─slapd-remain-after-exit.conf
             /etc/systemd/system/slapd.service.d
             └─ynh-override.conf
     Active: active (running) since Fri 2025-05-09 21:17:19 CEST; 1h 37min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 1541 ExecStart=/etc/init.d/slapd start (code=exited, status=0/SUCCESS)
      Tasks: 6 (limit: 3932)
        CPU: 986ms
     CGroup: /system.slice/slapd.service
             └─1640 /usr/sbin/slapd -h "ldap://localhost:389/ ldaps:/// ldapi:/// ldap://192.168.1.10:389" -g openldap -u openldap -F /etc/ldap/slapd.d

May 09 22:54:50 home.retiolus.net slapd[1640]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
May 09 22:54:50 home.retiolus.net slapd[1640]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
May 09 22:54:50 home.retiolus.net slapd[1640]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
May 09 22:54:50 home.retiolus.net slapd[1640]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
May 09 22:54:50 home.retiolus.net slapd[1640]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
May 09 22:54:50 home.retiolus.net slapd[1640]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
May 09 22:54:50 home.retiolus.net slapd[1640]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
May 09 22:54:50 home.retiolus.net slapd[1640]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
May 09 22:54:50 home.retiolus.net slapd[1640]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
May 09 22:55:08 home.retiolus.net slapd[1640]: slap_global_control: unrecognized control: 1.3.6.1.4.1.42.2.27.8.5.1