1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

43 Commits

Author SHA1 Message Date
Stefan Metzmacher
6a818e66ae events: 10.interface handle updateip event
metze

(This used to be ctdb commit a5cdf1277387f8c6292153c37fa9ceb64707d04f)
2010-01-20 11:11:02 +01:00
Stefan Metzmacher
50bff8c886 config: add CTDB_PARTIALLY_ONLINE_INTERFACES to ctdb.sysconfig
With this option set to "yes", we don't become unhealthy
as long as at least one interface is still available.

metze

(This used to be ctdb commit d054eb33c6ae92560cddb40732e5dcf622591a3c)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
5d2c3ef656 config: 10.interfaces call monitor_interfaces on startup
metze

(This used to be ctdb commit 615dec051c26aac628f120e96bf12fb39fc6d28a)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
94e7101070 config: 10.interfaces call ctdb ifaces and ctdb setifacelink for monitoring
metze

(This used to be ctdb commit c465f63585c419ba59a6b04cbbf78ae615a7259d)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
9c89dd9210 events: splitout a monitor_interfaces function in 10.interface
metze

(This used to be ctdb commit b5ba56dea57db97d6c6ba3e7582e74fe0e3041fc)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
9a43f5e42b events: 10.interfaces allow multiple interfaces per public address
metze

(This used to be ctdb commit f9837f8b6f887d28f29aeb3eeffe8cfb423b40b4)
2010-01-20 11:10:58 +01:00
Stefan Metzmacher
4493ba6ffa config: add interface_modify.sh and call it under flock to make modification on interfaces atomic
When two releaseip events run in parallel it's possible that the 2nd script
readds a secondary ip that was removed by the 1st script.

metze

(This used to be ctdb commit e02417b2a55c45ac2c125b1b3463c9c39e7bc07a)
2010-01-20 11:10:48 +01:00
Stefan Metzmacher
c251ac20fa events/10.interfaces: move some parts to helper functions
metze

(This used to be ctdb commit 24cd42769d8f32b90a8876a6a08a36ab23076cd1)
2010-01-20 09:44:37 +01:00
Stefan Metzmacher
fd06167caa server: add "init" event
This is needed because the "startup" event runs after the initial recovery,
but we need to do some actions before the initial recovery.

metze

(This used to be ctdb commit e953808449c102258abb6cba6f4abf486dda3b82)
2010-01-20 09:44:36 +01:00
Ronnie Sahlberg
50820f9e18 Bond devices can have any name the user configures, so
when checking link status for an interface, first
check if this interface is in fact a bond device
(by the precense of a /proc/net/bonding/IFACE file)
and use that file for checking status.

Othervise assume ib* is an infiniband interface which we donnt know how
to check, or otherwise it is an ethernet interface and ethtool should
hopefully work.

(This used to be ctdb commit 8cc6c5de3d7abb0b72eaa6e769e70963b02d84cb)
2009-12-09 11:33:04 +11:00
Ronnie Sahlberg
3ca3f4c771 make sure to also check that interfaces used for NATGW are ok
and have a link.
if not the node should become unhealthy

(This used to be ctdb commit 03b5bbaae1b53830a4cd20d3079ab8f45ffce923)
2009-12-09 11:13:29 +11:00
Martin Schwenke
db25ca69e5 Eventscript argument cleanups and introduction of ctdb_standard_event_handler.
The functions file no longer causes a side-effect by doing a shift.
It also doesn't set a convenience variable for $1.

All eventscripts now explicitly use "$1" in their case statement, as
does the initscript.  The absence of a shift means that the
takeip/releaseip events now explicitly reference $2-$4 rather than
$1-$3.

New function ctdb_standard_event_handler handles the status and
setstatus events, and exits for either of those events.  It is called
via a default case in each eventscript, replacing an explicit status
case where applicable.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3d55408cbbb3bb71670b80f3dad5639ea0be5b5b)
2009-12-01 17:43:47 +11:00
Martin Schwenke
ee513c1ba2 More untested eventscript factorisation.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ac655b0a65b32d809d47fec9821f7f31bb2fe2a7)
2009-11-19 15:00:17 +11:00
Ronnie Sahlberg
c915f2e5d5 add an extra test for the bond devices and check that there is an active slave.
this to handle the case where all links do have a physical layer, but where all slaves have been disabled using ifdown

(This used to be ctdb commit bf50709630df000583f2b0ef0edc177c01d60eaf)
2009-11-05 12:12:06 +11:00
Ronnie Sahlberg
ff8363697d treat interfaces with the name ethX* as bond devices
(This used to be ctdb commit 3997d7e5471810e9a2f145ce2e795073dfc5eded)
2009-10-21 11:34:17 +11:00
Ronnie Sahlberg
f3fd4bb659 redirect stderr to dev null since the rule might not exist when we try to unconditionally delete it
(This used to be ctdb commit e1d709f32196e19d4041ee2958e143791762e08f)
2009-09-02 03:12:27 +10:00
Michael Adam
34d2bb1f6c set broadcast addresses in the takeip event.
Michael

(This used to be ctdb commit e26d9d32e68e7db1cf4f96c47c0126e9e0b213be)
2009-08-28 06:50:53 +10:00
Michael Adam
1cf23b1bd7 Improve the monitor event test for ethernet interfaces (link detection).
On some systems, the ethtool link detection is not successful when a
cable is plugged but the interface has not been brought up previously.
This improves the test by bringing the interface up (without checking
for success here) and trying the ethtool test again afterwards.

Michael

(This used to be ctdb commit 0c2a7bf18c65452ca1c2f0539bf692507d91e3c6)
2008-12-12 09:19:23 +11:00
Michael Adam
54da843031 Use "grep -q" instead of "grep ... > /dev/null" in events.d/10.interfaces
This enhances readability.

Michael

(This used to be ctdb commit 9c6816e040d42d293eaf9ce41eff639135e8b2f5)
2008-12-12 09:18:30 +11:00
Ronnie Sahlberg
ddf2de2154 Do not fail the takeip event if the "ip addr add ..." command failed.
Let the event complete successfully.   the local recovery daemon will check that we have the address and reissue takip othervise.

There are several reasons why "ip addr add "  can fail, one is a misconfiguration
anothe ris that for ipv6 the stack is a lot more picky than for ipv4.     for examplke this WILL fail in ipv6 if there is a duplicate ip address on the network.

thus  this check could cause rolling-recoveries  which is why it has to go

(This used to be ctdb commit 12bc85c90a640a72ff538c003eb81da9dd1f2e3f)
2008-08-22 09:25:47 +10:00
Ronnie Sahlberg
78beb27966 From Alexander Saupp.
If we use vlan tagging and bonding we must strip the vlan part off the name
so we can check the main bonde device for status.

I.e. check bond0  instead of bond0.<VLANTAG>

(This used to be ctdb commit 795c190b004d404b84dda053593139ed51d345e5)
2008-07-28 17:07:44 +10:00
Ronnie Sahlberg
6820f4ea15 dont use an absolute pathname for the iptables tool
(This used to be ctdb commit 8f87385c09b16c0e32d797c4b442865d8185d9ee)
2008-02-07 15:36:26 +11:00
Ronnie Sahlberg
a8ea67203f change the IF interface is a BOND THEN xxx ELSE assume everything is ethernet
into a case and add an arm for ib*) (infiniband interfaces)

Dont try using ethtool on ib devices
(mii_tool doesnt work either)

IB does have a command ibv_devinfo   which can tell whether a physical port
is up or not   but it seems nontrivial to map this into a interface name such as ib0

(This used to be ctdb commit ab6bd25542946a732b4378f5476edfb466d6c000)
2008-02-07 09:35:46 +11:00
Andrew Tridgell
d815bc6f26 the event scripts no longer need to show a date, as its done by the main ctdbd logging function
(This used to be ctdb commit b5e691c4c3fe80b219a9ac355d28b766cb0303f3)
2008-01-16 22:06:44 +11:00
Ronnie Sahlberg
8599f2008d if bond* interfaces are used as public interfaces we can not rely on ethtool but
have to check /proc for the status instead

(This used to be ctdb commit 4ed7747267aea265b7a71c651abf6d5db4f4718b)
2007-10-29 10:51:16 +11:00
Ronnie Sahlberg
fa5d51c238 move the kill_tcp_connections() function from 10.interfaces to functions
(This used to be ctdb commit 055948530fb16bf49c42fc4489f29a21665156c0)
2007-10-11 07:27:38 +10:00
Andrew Tridgell
c62490569b cope with non-standard install dirs in event scripts
(This used to be ctdb commit 52fff5345873690a9cc86495f414343eaa3bd540)
2007-09-14 14:14:03 +10:00
Andrew Tridgell
955d4d8615 make sure all public IPs are removed at startup
(This used to be ctdb commit b16f33787f2a9471285037f4a6d470e826536570)
2007-09-14 11:56:40 +10:00
Ronnie Sahlberg
8edcd3f83f during startup make sure to delete any public addresses from any
interface

(This used to be ctdb commit 18d80ea6db39e61f60e4c01de164d58bcbd8ab10)
2007-09-14 10:37:10 +10:00
Andrew Tridgell
6fa6101b1a more shell scripting fixes in 10.interface
(This used to be ctdb commit 4ee2230b3f2ae7437a9d0cf973eb4645d276accd)
2007-09-13 11:57:42 +10:00
Andrew Tridgell
25940014c0 fixed script errors in 10.interface
(This used to be ctdb commit 0c759614d27758cef3eba5942b2cccad54193cbb)
2007-09-13 11:19:30 +10:00
Andrew Tridgell
023b885793 new approach for killing TCP connections on IP release
(This used to be ctdb commit c33a0db29b5604966f582b1f8c5fd66760c72197)
2007-09-13 10:24:48 +10:00
Andrew Tridgell
6c77184d96 - set arp_ignore to prevent replying to arp requests for addresses on loopback
- put removed IPs on loopback with scope host
- check for nul strings in ethtool call
;

(This used to be ctdb commit e2df1d6d08e67a36ff05a590a34c56e900741287)
2007-09-12 13:23:36 +10:00
Andrew Tridgell
a6728e0520 fixed location of arp_filter
(This used to be ctdb commit ea239c82fca2b9a648d21e5c603e632011958452)
2007-09-11 16:38:32 +10:00
Ronnie Sahlberg
4ac749bfa4 change the signature to ctdb_sys_have_ip() to also return:
a bool that specifies whether the ip was held by a loopback adaptor or 
not
 the name of the interface where the ip was held

when we release an ip address from an interface, move the ip address 
over to the loopback interface

when we release an ip address  after we have move it onto loopback, 
use 60.nfs to kill off the server side (the local part) of the tcp 
connection   so that the tcp connections dont survive a 
failover/failback

61.nfstickle,   since we kill hte tcp connections when we release an ip 
address   we no longer need to restart the nfs service in 61.nfstickle

update ctdb_takeover to use the new signature for ctdb_sys_have_ip

when we add a tcp connection to kill in ctdb_killtcp_add_connection()
check if either the srouce or destination address match a known public 
address

(This used to be ctdb commit f9fd2a4719c50f6b8e01d0a1b3a74b76b52ecaf3)
2007-09-10 07:20:44 +10:00
Ronnie Sahlberg
0ebd7beb4b set /proc/sys/net/ipv4/conf/all/arp_filter to 1 by default when
10.interfaces startsup

this setting makes the system only respond to APR requests from the NIC 
where the ip address is tied to and adds to the 
"principle of least surprise" when using multihoming servers

(This used to be ctdb commit 39ddf347dc45f599964a4c17e67e71faed00e544)
2007-09-08 08:09:02 +10:00
Ronnie Sahlberg
12ebb74838 change how we do public addresses and takeover so that we can have
multiple public addresses spread across multiple interfaces on each 
node.

this is a massive patch since we have previously made the assumtion that 
we only have one public address per node.

get rid of the public_interface argument.  the public addresses file 
now explicitely lists which interface the address belongs to

(This used to be ctdb commit 462ebbc791e906a6b874c862defea43235597ca8)
2007-09-04 09:50:07 +10:00
Ronnie Sahlberg
741af6a468 note that there is no link on the PUBLIC interface
(This used to be ctdb commit 3582f12f837dbd3c866cdffd2e7f5c20bae59d10)
2007-06-14 17:26:42 +10:00
Andrew Tridgell
2703ba210d merge from ronnie
(This used to be ctdb commit 1a0bd55dd27939110385e00dad73726a8ba66747)
2007-06-11 09:43:23 +10:00
Ronnie Sahlberg
47edceec09 when public interface is not set, print this to the logfile before
exiting the script

(This used to be ctdb commit 79f4a9faea7583aad6f39733d019ba416a4be6e5)
2007-06-11 08:42:51 +10:00
Andrew Tridgell
4e0b95ec9c newer versions of ip need the mask on del
(This used to be ctdb commit b5b13125506256f9ef6599498ee046e73b52df66)
2007-06-09 21:46:42 +10:00
Andrew Tridgell
76b7361c7e - added monitoring of rpc ports for nfs, and of Samba ports and directories
- added monitoring of the ethernet link state

When monitoring detects an error, the node loses its public IP address

(This used to be ctdb commit 0af57aead8c983511d25774b4ffe09fa5ff26501)
2007-06-06 12:08:42 +10:00
Andrew Tridgell
cc9f6d30d8 split out the basic interface handling, and run event scripts in a deterministic order
(This used to be ctdb commit 399e993a4a233a5953e1e7264141e5c7c8c8c711)
2007-06-04 15:09:03 +10:00