eventscripts: Rewrite the smb.conf cache file handling
authorMartin Schwenke <martin@meltin.net>
Mon, 28 Oct 2013 05:00:54 +0000 (16:00 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 29 Oct 2013 06:14:55 +0000 (17:14 +1100)
commitedda442b363f519b9c7ee4b9fb6d2e254536078b
treee480d793650defc16929a7a06e06d68fa644c21a
parentd9e2411ace8fa51937019b47c9c8634c4d4716be
eventscripts: Rewrite the smb.conf cache file handling

The background update is never guaranteed to complete before the cache
is used, so don't bother trying it at the beginning.  Instead, put a
timeout on a foreground update.

If the foreground update fails:

* If there's no available cache file then die.

* If there is a previous cache file then use it and log a warning.

* Do a background update at the end of the monitor event.

Also remove commas in the "smb ports" list before use, since (newer?)
testparm seem to insert commas into the default value.  Update the
associated test to add a comma.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 8c6f511254ecb0381a609b37e3a0ee6e5ec5d562)
ctdb/config/events.d/50.samba
ctdb/tests/eventscripts/stubs/testparm