Bug#407408: /etc/samba/dhcp.conf only created on change of wins server, but not initially

2007-03-02 Thread Bas Zoetekouw
severity 407408 serious
tag 407408 + patch
thanks

Hi!

I'm upgrading the severity of this bug, as it breaks functionality for
new installations.  Feel free to downgrade if you don't think this
should be fixed for etch.

Attached is a patch for the samba dhcp hook script to fix this bug.  It
checks if the file doesn't exist yet, and in that always creates the
file.  It also reload samba if the settings changed.
I've tested the patch on my machine here, and it seems to work well.

Greetings,
Bas.

--- samba-3.0.24/debian/samba-common.dhcp.eerst 2007-03-02 12:02:49.0 
+0100
+++ samba-3.0.24/debian/samba-common.dhcp   2007-03-02 14:54:41.149311039 
+0100
@@ -12,21 +12,29 @@
return
fi
 
-   # Nor should we continue if no settings have changed
-   if [ $new_netbios_name_servers = $old_netbios_name_servers ] \
-   [ $new_netbios_scope = $old_netbios_scope ]
+   umask 022
+
+   # check of the destination file doesn't exist yet (i.e. on first run 
after
+   # installing samb)
+   if [ ! -e $SAMBA_DHCP_CONF ];
then
-   return
-   fi
+   local serverlist=
+   else
+   # don't continue if no settings have changed
+   if [ $new_netbios_name_servers = $old_netbios_name_servers 
] \
+[ $new_netbios_scope = $old_netbios_scope ]
+   then
+   return
+   fi
 
-   # reparse our own file
-   local other_servers=`sed -n 
-es/[[:space:]]$interface:[^[:space:]]*//g; \
-   s/^[[:space:]]*wins server[[:space:]]*=[[:space:]]*//pi \
-   $SAMBA_DHCP_CONF`
+   # reparse our own file
+   local other_servers=`sed -n 
-es/[[:space:]]$interface:[^[:space:]]*//g; \
+   s/^[[:space:]]*wins 
server[[:space:]]*=[[:space:]]*//pi \
+   $SAMBA_DHCP_CONF`
 
-   umask 022
+   local serverlist=$other_servers
+   fi
 
-   local serverlist=$other_servers
for server in $new_netbios_name_servers
do
serverlist=$serverlist $interface:$server
@@ -52,6 +60,9 @@
then
echonetbios scope = $new_netbios_scope  $SAMBA_DHCP_CONF
fi
+
+   # now reload the samba server
+   /usr/sbin/invoke-rc.d samba reload
 }
 
 netbios_setup


Bug#407408: /etc/samba/dhcp.conf only created on change of wins server, but not initially

2007-03-02 Thread Christian Perrier
Quoting Bas Zoetekouw ([EMAIL PROTECTED]):
 severity 407408 serious
 tag 407408 + patch
 thanks
 
 Hi!
 
 I'm upgrading the severity of this bug, as it breaks functionality for
 new installations.  Feel free to downgrade if you don't think this
 should be fixed for etch.

I think that what you describe qualifies the bug for important severity


 - # Nor should we continue if no settings have changed
 - if [ $new_netbios_name_servers = $old_netbios_name_servers ] \
 - [ $new_netbios_scope = $old_netbios_scope ]
 + umask 022

I read this very quickly but wouldn't that result in a if not
followed by a then ?




signature.asc
Description: Digital signature


Bug#407408: /etc/samba/dhcp.conf only created on change of wins server, but not initially

2007-03-02 Thread Bas Zoetekouw
Hi Christian!

You wrote:

  I'm upgrading the severity of this bug, as it breaks functionality for
  new installations.  Feel free to downgrade if you don't think this
  should be fixed for etch.
 
 I think that what you describe qualifies the bug for important severity

Fine with me, in principle, although I do think it would be nice if this
could be solved before etch.

  -   # Nor should we continue if no settings have changed
  -   if [ $new_netbios_name_servers = $old_netbios_name_servers ] \
  -   [ $new_netbios_scope = $old_netbios_scope ]
  +   umask 022
 
 I read this very quickly but wouldn't that result in a if not
 followed by a then ?

Nope, it's just diff being a bit stupid and not knowing about sh syntax.

Greetings,
Bas.

-- 
Kind regards,
++
| Bas Zoetekouw  | GPG key: 0644fab7 |
|| Fingerprint: c1f5 f24c d514 3fec 8bf6 |
| [EMAIL PROTECTED], [EMAIL PROTECTED] |  a2b1 2bae e41f 0644 fab7 |
++ 



Bug#407408: /etc/samba/dhcp.conf only created on change of wins server, but not initially

2007-03-02 Thread Christian Perrier
   I'm upgrading the severity of this bug, as it breaks functionality for
   new installations.  Feel free to downgrade if you don't think this
   should be fixed for etch.
  
  I think that what you describe qualifies the bug for important severity
 
 Fine with me, in principle, although I do think it would be nice if this
 could be solved before etch.

Let's see what do the other team members think about this.

 
   - # Nor should we continue if no settings have changed
   - if [ $new_netbios_name_servers = $old_netbios_name_servers ] \
   - [ $new_netbios_scope = $old_netbios_scope ]
   + umask 022
  
  I read this very quickly but wouldn't that result in a if not
  followed by a then ?
 
 Nope, it's just diff being a bit stupid and not knowing about sh syntax.


OK. I actually overread the patch anyway...:)




signature.asc
Description: Digital signature


Bug#407408: /etc/samba/dhcp.conf only created on change of wins server, but not initially

2007-01-18 Thread Erik Thiele
Package: samba
Version: 3.0.23d-2+b1

The file /etc/samba/dhcp.conf is included from your smb.conf file to
get the wins server by DHCP. This is done by the
script /etc/dhcp3/dhclient-enter-hooks.d/samba. There are three issues
with this script:

1) when i CHANGE the netbios-name-servers in my dhcp server and then
do a ifdown and ifup to launch dhclient, then the script creates the
samba dhcp.conf file correctly. but if i run my system for some time
and then decide to install the samba package, the dhclient script will
NOT create the dhcp.conf file, because no change in
netbios-name-servers has occured since the last run of dhclient.


2) when first creating the file /etc/samba/dhcp.conf, the script prints
the error message: 

sed: can't read /etc/samba/dhcp.conf: No such file or directory

Maybe a message like creating dhcp.conf from scratch because it is
missing or even no message at all would be better.


3) in case of a change in /etc/samba/dhcp.conf, the script should let
the samba server reload its configuration files, otherwise the change
is ignored by the samba server.



cya  thx for all the work
erik


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]