Broken smb.conf during samba shares update. Found by Stefan: https://forge.univention.org/bugzilla/show_bug.cgi?id=57367#c0 The share configuration is deleted here: https://git.knut.univention.de/univention/ucs/-/blob/5.0-7/services/univention-samba4/samba-shares.py?ref_type=heads#L137 and later rewritten here: https://git.knut.univention.de/univention/ucs/-/blob/5.0-7/services/univention-samba4/samba-shares.py?ref_type=heads#L168 During that time frame, the include in shares.conf points to a non existing file and the following code fails: ``` >>> from samba.param import LoadParm >>> lp = LoadParm() >>> lp.load_default() Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: Unable to load default file ``` I expect that time frame to be very short, so it might not be the reason for bug 57367. Though I think it still makes sense to fix this just to make sure it is not the problem.
Note: lp.load_default() doesn't throw an error in 5.2 anymore. It seems to be quite resilient now and just ignores any broken includes.
It's not only that the include file might be missing: The code in samba-shares.py does not work with a temp file and atomic file handling. Therefore it's possible that due to concurrency the samba process reads an include file that is only halfway written to disk, which might also create followup problems (access control etc). Suggestion: - create temp file for new/updated include file - use os.rename to move it atomically to final position