Problem: Samba does not start after a reboot

Problem

Samba does not start after a reboot.

Solution

The problem can be caused by old samba init scripts which are executed during a reboot:

root@server:~# ls -lah /etc/rc?.d/*samba*
lrwxrwxrwx 1 root root 15 Mär 29  2021 /etc/rc0.d/K01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Mär 29  2021 /etc/rc0.d/K03samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Mär 29  2021 /etc/rc1.d/K01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Mär 29  2021 /etc/rc1.d/K03samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 21 Mär 30  2021 /etc/rc2.d/S02samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Mär 30  2021 /etc/rc2.d/S07samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Mär 30  2021 /etc/rc3.d/S02samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Mär 30  2021 /etc/rc3.d/S07samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Mär 30  2021 /etc/rc4.d/S02samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Mär 30  2021 /etc/rc4.d/S07samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Mär 30  2021 /etc/rc5.d/S02samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Mär 30  2021 /etc/rc5.d/S07samba -> ../init.d/samba
lrwxrwxrwx 1 root root 15 Mär 29  2021 /etc/rc6.d/K01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Mär 29  2021 /etc/rc6.d/K03samba-ad-dc -> ../init.d/samba-ad-dc
root@server:~# ls -1 /etc/rc?.d/?0?samba
/etc/rc0.d/K01samba
/etc/rc1.d/K01samba
/etc/rc2.d/S07samba
/etc/rc3.d/S07samba
/etc/rc4.d/S07samba
/etc/rc5.d/S07samba
/etc/rc6.d/K01samba
root@server:~# rm /etc/rc?.d/?0?samba
Mastodon