[PATCH] samba_upgradedns

Rowland Penny rpenny at samba.org
Fri Feb 15 14:58:19 UTC 2019

Hi, I inadvertently downgraded my DC to the internal DNS server with
samba_upgradedns (don't ask). So I quickly ran it again with
'--dns-backend=BIND9_DLZ' option, expecting it to fix the problem. It
didn't, instead I got this:

Failed to create link /var/lib/samba/private/dns.keytab -> /var/lib/samba/bind-dns/dns.keytab: No such file or directory
Failed to chown /var/lib/samba/bind-dns to bind gid 114
Failed to chown /var/lib/samba/bind-dns/dns.keytab to bind gid 114
Traceback (most recent call last):
  File "/usr/sbin/samba_upgradedns", line 533, in <module>
    create_dns_dir(logger, paths)
  File "/usr/lib/python2.7/dist-packages/samba/provision/sambadns.py", line 699, in create_dns_dir
    os.mkdir(dns_dir, 0o770)
OSError: [Errno 2] No such file or directory:

Wanting to get the problem fixed, I ran:

mkdir -p /var/lib/samba/bind-dns

Ran the command again, this time everything worked.

I didn't have '/var/lib/samba/bind-dns' because the DC was provisioned
on an earlier version where the 'bind-dns' dir didn't exist and had
been upgraded to 4.9.4 by distro packages.

The attached patch creates the directory if it doesn't exist.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba_upgradedns-If-upgrading-to-Bind9.patch
Type: text/x-patch
Size: 1118 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190215/c1684d88/samba_upgradedns-If-upgrading-to-Bind9.bin>

More information about the samba-technical mailing list