Bug 7301 - DNS: samba_dnsupdate expect dns_update_list to be /usr/local/samba/private even if the samba server has been started with another private location
Summary: DNS: samba_dnsupdate expect dns_update_list to be /usr/local/samba/private ev...
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Andrew Tridgell
QA Contact: samba4-qa@samba.org
Depends on:
Reported: 2010-03-27 09:21 UTC by Matthieu Patou
Modified: 2010-04-19 02:21 UTC (History)
0 users

See Also:

Patch for fixing this bug (1.25 KB, patch)
2010-03-28 12:35 UTC, Matthieu Patou
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Patou 2010-03-27 09:21:23 UTC
The title of the bug says mostly all.

/usr/local/src/samba4/source4/scripting/bin/samba_dnsupdate: Traceback (most recent call last):
/usr/local/src/samba4/source4/scripting/bin/samba_dnsupdate:   File "/usr/local/src/samba4/source4/scripting/bin/samba_dnsupdate", line 256, in <module>
/usr/local/src/samba4/source4/scripting/bin/samba_dnsupdate:     file = open(dns_update_list, "r")
/usr/local/src/samba4/source4/scripting/bin/samba_dnsupdate: IOError: [Errno 2] No such file or directory: '/usr/local/samba/private/dns_update_list'

So if you start samba with a configuration file that indicate that the private dir is somewhere else dns_update_list still looks in /usr/local/samba/private.
That's due to the fact that configuration file location is not transmitted to the samba_dnsupdate.
Comment 1 Matthias Dieter Wallnöfer 2010-03-28 03:19:22 UTC
No, this should be no bug. Look at the code (in the samba_dnsupdate.py):

 254 dns_update_list = lp.private_path('dns_update_list')


 256 file = open(dns_update_list, "r")

It calls loadparm to get the private directory. So you probably have to set the "private path" parameter in "smb.conf" to get it working.

And this "...even if the samba server has been started with another private location" should mean that you configured s4 with one private location and then start s4 with another one? Do you achieve this with a parameter?
Comment 2 Matthieu Patou 2010-03-28 05:48:04 UTC
So if it's not the problem I describe what can it be ?

Also please tell me how this object loadparm knows about what is the content of your smb.conf ? There is no magic in this ... if you want to use a configuration file that is somewhere else you MUST add -s otherwise your instantiation of lp (line 65) will use the default place (ie. /usr/local/samba/etc/smb.conf) for the configuration file. 

And it turns out that starting manually samba_dnsupdate with the -s parameter works ... so I'm 99% sure that the bug is valid and the reason is the good one.
Comment 3 Andrew Bartlett 2010-03-28 05:58:24 UTC
This seems like a reasonable bug, with a reasonable fix - always invoke the samba_dnsupdate with -s 
Comment 4 Matthieu Patou 2010-03-28 07:46:32 UTC
Btw I've got the reasonable fix. 
Comment 5 Matthieu Patou 2010-03-28 12:35:14 UTC
Created attachment 5554 [details]
Patch for fixing this bug
Comment 6 Matthias Dieter Wallnöfer 2010-03-28 13:09:15 UTC
Andrew, could you comment on and maybe push the patch?
Comment 7 Andrew Tridgell 2010-04-19 02:20:59 UTC
fixed in git master