I just installed samba4 Version 4.0.5 from git during "samba domain provision" I got the following Error:
root@samba4-1:~/samba4# samba-tool domain provision
Realm [EXAMPLE.NET]: EXAMPLE.NET
Domain [EXAMPLE]: EXAMPLE
Server Role (dc, member, standalone) [dc]: dc
DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE)\
DNS forwarder IP address (write 'none' to disable forwarding)\
Looking up IPv4 addresses
Looking up IPv6 addresses
ERROR(<type 'exceptions.OSError'>): uncaught exception - [Errno 2] \
No such file or directory: '/usr/local/samba/var/locks'
line 175, in _run
return self.run(*args, **kwargs)
line 398, in run
line 2019, in provision
I found out, that the directory /usr/local/samba/var/ was not present. I createt the directory and "samba-tool domain provision" worked.
The same with:
/usr/local/samba/var/run/ and /usr/local/samba/var/lib are also missing.
After crating the directories everything worked fine.
I think this has been fixed for quite a while.
Now provision uses directory_create_or_exists() that raises a ProvisioningError which samba-tool converts into a CommandError, which becomes a "nice" message.