When is winbindd ready?

Volker Lendecke Volker.Lendecke at SerNet.DE
Sun Apr 28 06:53:00 MDT 2013


On Sat, Apr 27, 2013 at 12:29:15PM -0700, C.J. Adams-Collier KF7BMP wrote:
> Howdy list,
> 
> I'm automating the process of deploying samba 3.5.21 to a bunch of
> systems.  After installing the binaries and service launchers, tweaking
> system configuration files and synchronizing time, the script starts the
> service and then queries winbind with wbinfo for a user/SID known to
> exist.
> 
> I am currently getting false negatives due to spin-up time of winbindd.
> The service launcher returns control to the deployment script before
> winbindd is fully prepared to process queries.  Is there a common way to
> ask winbindd if it is ready yet to answer queries and block until it's
> good to go?  I am currently sleeping for 1s on the hardware in my lab.
> The systems in the wild, often resource-constrained virtual machines,
> seem to take substantially more time.  As you can see, this is a
> sub-optimal and error-prone solution.  I would hate to block for 10s on
> systems which are ready to answer queries 500ms after launching the
> service.
> 
> One solution that would not work but is close would be to enter a while
> loop and sleep/retry until wbinfo gives me the expected result.  Of
> course this would not work if there's a firewall or something similar
> blocking winbindd from communicating with the directory server.  So
> maybe a max_retries threshold.  But still, this all smells like a nasty
> hack to me.  I bet there's a way to ask winbindd whether it thinks it is
> ready to answer queries or whether it thinks it has failed to link up
> with the directory server.

wbinfo --ping-dc is meant to do exactly what you want I
think. I'm not 100% certain when it was introduced though.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list