Samba fails to start if LDAP is not ready
Migrated from: https://tracker.clearos.com/view.php?id=10621
Reported by: Ben Chambers
Samba highly dependent on OpenLDAP. With systemd introduced in version 7, a possible race condition can occur on system updates when both LDAP and Samba are restarted.
If Samba loses, it fails to restart.
Make changes to make Samba restart more robust on updates.
Developer comment:
This needs to be confirmed if it is still an issue.
A fix was put in to the winbind unit file with anAfter=slapd
. The smb unit file had an After=winbind
After we reverted to upstream samba a fix was put in the slapd unit file so now we have in the following unit files:
- smb:
After=network.target network-online.target nmb.service winbind.service
- winbind:
After=network.target nmb.service
- nmb:
After=network.target network-online.target
- slapd:
Before=winbind.service
At the same time, winbind has been added to /usr/clearos/apps/base/deploy/servicewatch so it will attempt to restart every 5 minutes if it is enabled (which can create a load of noise in the logs #18)