When is winbindd ready?

C.J. Adams-Collier KF7BMP cjac at colliertech.org
Sat Apr 27 13:29:15 MDT 2013


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.

Thanks in advance,

C.J.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130427/bb047186/attachment.pgp>


More information about the samba-technical mailing list