[Samba] winbind separator oddity

Joerg Thuemmler listen at vordruckleitverlag.de
Mon Oct 19 00:39:41 MDT 2009

Barry R Cisna schrieb:
> Joerg,
> Thanks for the idea on winbind dyeing over time. Unfortunately that was
> not happening. 
 I was hoping I could figure out some sort of
> script to run as a cron job on early Monday morning to automate my
> workaround,,,? if you have any ideas on this let me know. Thanks again
> Barry


seems very strange to me all this ... there should be some reloading or
change of winbind configs in between maybe a routing issue... very odd.
As for a workaround, this should be simple, but reading your 1st post,
I'm not shure what does the trick: commenting the line "winbind
separator" itself or insert a line before the line "winbind...". My
script (untested) shows the first, which seems more logically to my (if
there can be spoken of logic). It could be shortened of course but so I
hope it's better to understand

# winbind wrapper
# call it in /etc/crontab with   1 4 * * 1 root <pathtowinbindwrapper>
grep -q  "# winbind separator = +"  # is it commented out?
if [ "$?" != "0" ]
 then				    # not: so do so
  sed -e 's/winbind separator = +/# winbind separator = +/' \
</etc/smb.conf >/etc/smb.conf.tmp
 else				    # yes: vice versa
  sed -e 's/# winbind separator = +/winbind separator = +/' \
</etc/smb.conf >/etc/smb.conf.tmp
mv /etc/smb.conf.tmp /etc/smb.conf  # replace by result
/etc/rc.d/nmb restart		    # and restart
/etc/rc.d/smb restart

that should do. Test it in a sandbox with a copy of your file better.
"\" means line should not be splitted. Script assumes there's only one
"winbind separator" line in /etc/smb.conf

cu jth

More information about the samba mailing list