[SCM] Samba Shared Repository - branch master updated
Amitay Isaacs
amitay at samba.org
Thu Jul 13 15:58:02 UTC 2017
The branch, master has been updated
via 4e68d37 ctdb-docs: Update documentation of ipreallocated event
via 3e85cbf ctdb-common: Set close-on-exec when creating PID file
from bebf90f libwbclient: Fix CID 1414781 Dereference null return value
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 4e68d377a7227042b3cc09274ecf8dd820c3d386
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jul 12 12:22:10 2017 +1000
ctdb-docs: Update documentation of ipreallocated event
This was out of date due to the removal of service_check_reconfigure()
and similar.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Thu Jul 13 17:57:11 CEST 2017 on sn-devel-144
commit 3e85cbfd7541d8f30ce1f3244ebcc44332b394fe
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jul 12 13:41:17 2017 +1000
ctdb-common: Set close-on-exec when creating PID file
Otherwise, for example, the file descriptor for the main PID file will
leak all the way down to event scripts.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12898
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
-----------------------------------------------------------------------
Summary of changes:
ctdb/common/pidfile.c | 8 ++++++++
ctdb/config/events.d/README | 35 +++++++++++++++++------------------
2 files changed, 25 insertions(+), 18 deletions(-)
Changeset truncated at 500 lines:
diff --git a/ctdb/common/pidfile.c b/ctdb/common/pidfile.c
index b3f29e3..51c0c25 100644
--- a/ctdb/common/pidfile.c
+++ b/ctdb/common/pidfile.c
@@ -22,6 +22,8 @@
#include <talloc.h>
+#include "lib/util/blocking.h"
+
#include "common/pidfile.h"
struct pidfile_context {
@@ -61,6 +63,12 @@ int pidfile_create(TALLOC_CTX *mem_ctx, const char *pidfile,
goto fail;
}
+ if (! set_close_on_exec(fd)) {
+ close(fd);
+ ret = EIO;
+ goto fail;
+ }
+
pid_ctx->fd = fd;
lck = (struct flock) {
diff --git a/ctdb/config/events.d/README b/ctdb/config/events.d/README
index 11da702..36f94bb 100644
--- a/ctdb/config/events.d/README
+++ b/ctdb/config/events.d/README
@@ -159,33 +159,32 @@ updateip <old-interface> <new-interface> <ip-address> <netmask-bits>
ipreallocated
- This event is triggered after "releaseip", "takeip" and
- "updateip" events during public IP address (re)assignment.
+ This event is triggered on all nodes as the last step of
+ public IP address (re)assignment. It is unconditionally
+ triggered after any "releaseip", "takeip" and "updateip"
+ events, even though these events may not run on some nodes if
+ there are no relevant changes. That is, the "ipreallocated"
+ event is triggered unconditionally, even on nodes where public
+ IP addresses assignements have not changed.
This event is used to reconfigure services.
- This event runs even if public IP addresses on a node have not
- been changed. This allows reconfiguration to depend on the
- states of other nodes rather that just IP addresses.
+ Since "ipreallocated" is always run, this allows
+ reconfiguration to depend on the states of other nodes rather
+ that just IP addresses.
Example: 11.natgw recalculates the NAT gateway master and
updates the relevant network configuration on each node if the
NAT gateway master has changed.
Additional notes for "takeip", "releaseip", "updateip",
-ipreallocated":
+"ipreallocated":
* Failure of any of these events causes IP allocation to be retried.
-* The "ipreallocated" event is run on all nodes. It is even run if no
- "takeip", "releaseip" or "updateip" events were triggered.
-
-* An event script can use ctdb_service_set_reconfigure() in "takeip"
- or "releaseip" events to flag that its service needs to be
- reconfigured. The event script can then define a
- service_reconfigure() function, which will be implicitly run before
- the "ipreallocated" event. This is a useful way of performing
- reconfiguration that is conditional upon public IP address changes.
-
- This means an explicit "ipreallocated" event handler is usually not
- necessary.
+* An event script can use ctdb_service_set_reconfigure() in "takeip",
+ "releaseip" or "updateip" events to flag that its service needs to
+ be reconfigured. The "ipreallocated" event can then use
+ ctdb_service_needs_reconfigure() to test if there were public IPs
+ changes to determine what type of reconfiguration (if any) is
+ needed.
--
Samba Shared Repository
More information about the samba-cvs
mailing list