Problem:
The 96univention-samba4 joinscript fails. In the logfile you see this error message.
INFO 2023-08-02 12:16:31,721 pid:24190 /usr/lib/python2.7/dist-packages/samba/provision/__init__.py #1307: Pre-loading the Samba 4 and AD schema
Unable to determine the DomainSID, can not enforce uniqueness constraint on local domainSIDs
Could not find machine account in secrets database: Failed to fetch machine account password for SUN from both secrets.ldb (Could not find entry to match filter: '(&(flatname=SUN)(objectclass=primaryDomain))' base: 'cn=Primary Domains': No such object: dsdb_search at ../../source4/
dsdb/common/util.c:4808) and from /var/lib/samba/private/secrets.tdb: NT_STATUS_CANT_ACCESS_DOMAIN_INFO
ERROR(<class 'samba.provision.MissingShareError'>): uncaught exception - ProvisioningError: Existing smb.conf does not have a [sysvol] share, but you are configuring a DC. Please remove /etc/samba/smb.conf or add the share manually.
File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 185, in _run
return self.run(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/samba/netcmd/domain.py", line 700, in run
backend_store=backend_store)
File "/usr/lib/python2.7/dist-packages/samba/join.py", line 1545, in join_DC
ctx.do_join()
File "/usr/lib/python2.7/dist-packages/samba/join.py", line 1438, in do_join
ctx.join_provision()
File "/usr/lib/python2.7/dist-packages/samba/join.py", line 885, in join_provision
backend_store=ctx.backend_store
File "/usr/lib/python2.7/dist-packages/samba/provision/__init__.py", line 2594, in provision
raise MissingShareError("sysvol", paths.smbconf)
Deleted CN=RID Set,CN=OPSI,OU=Domain Controllers,DC=local,DC=schein,DC=de
Investigation:
This part of the message is important and gives a first hint:
ERROR(<class ‘samba.provision.MissingShareError’>): uncaught exception - ProvisioningError: Existing smb.conf does not have a [sysvol] share, but you are configuring a DC. Please remove /etc/samba/smb.conf or add the share manually.
Solution:
ucr set samba/share/sysvol='true'