summaryrefslogtreecommitdiffstats
path: root/ctdb/config/functions
Commit message (Collapse)AuthorAgeFilesLines
...
* eventscripts: NFS RPC checks allows "nfsd" in addition to "knfsd"Martin Schwenke2013-05-061-1/+1
| | | | | | | | Want nfs_check_rpc_services() to support filenames without the 'k'. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d9775fcbd6e30eef8382bea68e2f9bad2309f2c1)
* eventscripts: New function nfs_check_rpc_services()Martin Schwenke2013-05-061-0/+29
| | | | | | | | | | | | | | This is intended to replace nfs_check_rpc_service(), which builds configuration into eventscripts. nfs_check_rpc_services() uses a directory of configuration checks that can be edited by an administrator. The files have one limit check and a set of actions per line. The program name is extracted from the file name. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9bc8fbee6550ed2814fb35c70d57fab21ef1b8fd)
* eventscripts: nfs_check_rpc_action() should be _nfs_check_rpc_action()Martin Schwenke2013-05-061-2/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 5a717fd495ba5a2bfd481d69f38b68fa4576716f)
* eventscripts: Factor out common code from nfs_check_rpc_service()Martin Schwenke2013-05-061-6/+17
| | | | | | | | This creates new function _nfs_check_rpc_common(). Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit cc3bb42e48bbdabd19187c231846b98589b4f4f3)
* eventscripts: Remove ganesha support from nfs_check_rpc_service()Martin Schwenke2013-05-061-6/+0
| | | | | | | | | This is unused so doesn't need to be maintained. An attempt to use it now will explicitly fail rather than implicitly fail via bitrot. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 887733dd7be53158bfe07b30ef31b611d0f8122f)
* Revert "Eventscript functions: add optional version to nfs_check_rpc_service()"Martin Schwenke2013-05-061-10/+4
| | | | | | | | | | | This reverts commit 92f74fd589467b46c758e116e97417edfe8773d7. This change is unused and is just complicating the function. Conflicts: config/functions (This used to be ctdb commit 77302dbfd85754e02559eccb2dd6c090db0b6b9f)
* eventscripts: Move rpc.statd existence check into nfs_check_rpc_service ()Martin Schwenke2013-05-061-0/+6
| | | | | | | | | The code in 60.nfs is going to be genericised, so make all the checks look the same. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 15b0f78cbf8d6ba481b7eba9e4fe3f4270214c72)
* eventscripts: Factor NFS RPC check action code into nfs_check_rpc_action()Martin Schwenke2013-05-061-46/+58
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 4b4e7d8f0e8dcbab987e374d06ffaa21c06da0d3)
* eventscripts: Remove unused function ctdb_check_counter_limit()Martin Schwenke2013-05-061-15/+0
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a8ef00608e48a551a334aded206146807aeb4c5a)
* eventscripts: Minor cleanups for killtcp/tickle functionsMartin Schwenke2013-05-061-16/+17
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 25ef4f655f1efc833deb5e244f9fff461e92f439)
* eventscripts: Tweak the timeout check in kill_tcp_connections()Martin Schwenke2013-05-061-7/+13
| | | | | | | | | | | | | | This has 2 advantages: 1. It uses get_tcp_connections_for_ip() to check for leftover connections, instead of custom code. 2. It checks for the timeout condition before sleeping. The current code sleeps and then checks, so wastes a second. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 60a08eb96e1d97aab31e9bd4af01683c650541c2)
* eventscripts: In killtcp/tickle functions, $_failed should be booleanMartin Schwenke2013-05-061-13/+12
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 319c1b68d5aa78f82a68febcad233a7c78afc887)
* eventscripts: Remove unused $_killcount from tickle_tcp_connections()Martin Schwenke2013-05-061-2/+0
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 8514ca56830b30e7f0eb5018632640daaf8ff65d)
* eventscripts: Refactor connection listing in killtcp and tickle functionsMartin Schwenke2013-05-061-51/+58
| | | | | | | | | Uses new function get_tcp_connections_for_ip(). This avoids using a temporary file and running netstat twice. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a621622903c7ef17764b15293d6ea8df5a53c7e1)
* eventscripts: Reimplement kill_tcp_connections_local_only()Martin Schwenke2013-05-061-35/+10
| | | | | | | | ... using kill_tcp_connections() Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 10e4db8f796d1e3259733180494db3b4bbad291a)
* eventscripts: Change handling of one-way kills in kill_tcp_connections()Martin Schwenke2013-05-061-5/+6
| | | | | | | | | This change is a no-op. However, In a subsequent commit we'll merge kill_tcp_connections_local_only() with this function. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 23c0f5f48e3e5a0c1a3254c582299f7893cf0d33)
* eventscripts: Remove unnecessary variables from killtcp/tickle functionsMartin Schwenke2013-05-061-22/+11
| | | | | | | | | Setting these variables spawns lots of unnecessary processes, which would surely slow down these functions on a busy system. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3eae161472e6352f7f656851c73dc056f95113eb)
* eventscripts: Clean up ctdb_check_command()Martin Schwenke2013-05-061-9/+8
| | | | | | | | | | * Command is now multiple arguments, preserving quoting * $service_name no longer printed, no longer an argument * Debug output from failed command Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9e25fb261447a196de05937052779b36e75e7215)
* eventscripts; Cleanup up ctdb_check_directories()Martin Schwenke2013-05-061-6/+7
| | | | | | | | | The documentation comments are wrong... and remove option $service_name argument. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d9e6cb945c5edac9ca6405c9228bf647fab814f5)
* eventscripts: Assert that $service_name is set in a few key placesMartin Schwenke2013-05-061-0/+14
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3d0a7d83ddc824961d876fc9afba829c90aef3e7)
* eventscripts: counters default to $script_name if $service_name not setMartin Schwenke2013-05-061-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit fff88940f71058e4eefd65f50a6701389c005c17)
* eventscripts: Simplify handling of $service name in "managed" functionsMartin Schwenke2013-05-061-6/+4
| | | | | | | | | | | | | | | | | | | | Complicated argument handling was introduced to deal with multiple services per eventscript. This was a failure and we split 50.samba. This simplifies several functions to use global $service_name unconditionally instead of having an optional argument. $service_name is no automatically longer set in the functions file. This means it needs to be explicitly set in 13.per_ip_routing because this script uses ctdb_service_check_reconfigure(). Eventscript unit test infrastructure needs to set $service_name during fake service setup, and policy routing tests need to be updated accordingly. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 27aab8783898a50da8c4bc887b512d8f0c0d842c)
* eventscripts: Simplify handling of $service name in start/stop functionsMartin Schwenke2013-05-061-9/+7
| | | | | | | | | | | | Complicated argument handling was introduced to deal with multiple services per eventscript. This was a failure and we split 50.samba. This simplifies several functions to use global $service_name unconditionally instead of having an optional argument. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b5802c4735e1c719a5cf9ce69489d5947bd5e8c5)
* eventscripts: Simplify handling of $service name in service_managementMartin Schwenke2013-05-061-20/+16
| | | | | | | | | | | | Complicated argument handling was introduced to deal with multiple services per eventscript. This was a failure and we split 50.samba. This simplifies several functions to use global $service_name unconditionally instead of having an optional argument. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e24baac0d2952e86d5ff31235901f06e2f2b2449)
* eventscripts: Simplify handling of $service name in reconfigure functionsMartin Schwenke2013-05-061-18/+15
| | | | | | | | | | | | Complicated argument handling was introduced to deal with multiple services per eventscript. This was a failure and we split 50.samba. This simplifies several functions to use global $service_name unconditionally instead of having an optional argument. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c2ea72ff565222f9edab408638bd45dbba6e8ff7)
* eventscripts: Remove unused function ctdb_check_counter_equal()Martin Schwenke2013-05-061-12/+0
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit fd536a26b310b5bf9628da62cca0b425f4a54030)
* scripts: Fix script_log() regressionMartin Schwenke2013-05-061-1/+1
| | | | | | | | | | | | 5940a2494e9e43a83f2bca098bd04dfc1a8f2e93 makes script_log() always pass a message to logger, so script_log() can no longer log stdin. Put all the tag fu in the actual tag so the message argument is empty if no message was passed. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9dee4c84273633b9ad82e94dabbf0e6f86edbcef)
* scripts: Ensure even external scripts get tagged in logs as "ctdbd"Martin Schwenke2013-04-221-2/+2
| | | | | | | | | Our practice is to search logs for "ctdbd:". We want to make sure we find everything. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 5940a2494e9e43a83f2bca098bd04dfc1a8f2e93)
* eventscripts: Ensure directories are createdMartin Schwenke2013-04-221-0/+6
| | | | | | | | | | | | Previous commits stopped the top level of the script from creating certain directories but some functions assume that required directories exist. Create those directories instead. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0076cfc4666e5a96eb2c8affb59585b090840e00)
* scripts: Clean up update_tickles() and handling of associated directoryMartin Schwenke2013-04-191-5/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 700cf95a1f29b4b88460a00a55d57a9e397011e0)
* scripts: Use $CTDB_SCRIPT_DEBUGLEVEL instead of something more complexMartin Schwenke2013-04-191-35/+3
| | | | | | | | | | | | | | | | | | | The current logic is horrible and creates an unnecessary file. Let's make the script debug level independent of ctddb's debug level. * Have debug() use $CTDB_SCRIPT_DEBUGLEVEL directly * Remove ctdb_set_current_debuglevel() * Remove the "getdebug" command from ctdb stub in eventscript unit tests * Update relevant eventscript unit tests to use $CTDB_SCRIPT_DEBUGLEVEL Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 85efa446c7f5c5af1c3a960001aa777775ae562f)
* Changes for unobtrusive recovery and new method for health check.Srikrishan Malik2013-01-111-7/+1
| | | | | | | | | | | | Unobtrusive recovery: Ganesha will not be restarted on failovers. Ganesha health: Use the counters in /var/lib/nfs/ganesha_local to track progress instead of the null call which can timeout if the server is too busy. Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com> Signed-off-by: Lance Russell <lancerus@us.ibm.com> (This used to be ctdb commit 0e651e9da0f1f3c836b4474612ab13d0ccd272d9)
* scripts: Make script_log() use supplied message, stop logger from hangingMartin Schwenke2013-01-081-1/+1
| | | | | | | | | | When using syslog any provided message arguments are ignored and not passed to logger. This means that logger blocks waiting on stdin. That's bad. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 50abf597cefe6f8ea2a2ff7694bf84641344a9b1)
* scripts: Make drop_all_public_ips() more robustMartin Schwenke2013-01-081-3/+32
| | | | | | | | | | | | Incorporate some of the logic from ctdb-crash-cleanup.sh that ensures IPs are deleted even if they have the wrong netmask or are on the wrong interface. Factoring out some of the code will allow it to be used elsewhere. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 03356fd5ae7a3ac35fde0289cbea7c71ecf07367)
* scripts: Move drop_all_public_ips() to the functions fileMartin Schwenke2013-01-081-0/+6
| | | | | | | | ... so it can be improved and used elsewhere. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b23c30253cc9eb274b895cac0f8c65245ba0a200)
* Eventscripts: Change the default reconfigure action to do nothingMartin Schwenke2013-01-071-2/+2
| | | | | | | | | | | | | A default action of restarting the service doesn't obey the principle of least surprise. It cause the NFS service to be implicitly reintroduced. This allows no-op functions to be removed from some eventscripts and service restart functions to be added to others. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c75b5e5b4d000f5c7dab403df8238ceed390c1c0)
* scripts: Refactor logging code in initscript and functions fileMartin Schwenke2012-10-181-8/+23
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 5ee242c949a98bb7397e0f7368b20d44c06fe772)
* config/functions: fix a commentMichael Adam2012-10-171-1/+1
| | | | | | | | ctdb_check_counter_limits does not fail but succeed if count >= limit Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit af540ef728303b4a0a188b17c695e9aefab34489)
* Eventscripts: Add service-start and service-stop pseudo-eventsMartin Schwenke2012-10-101-2/+28
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit be4ad110ede9981b181ac28f31ffd855a879d5df)
* eventscripts: Auto-start/stop services in backgroundMartin Schwenke2012-10-031-2/+26
| | | | | | | | | | | If $CTDB_SERVICE_AUTOSTARTSTOP="yes" then service start/stop is done in the background with logging. Fix some unit tests for samba and winbind. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3a3dae4cb5ec8b4b8381a4013adda25b87641f3a)
* Eventscripts: Modernise 60.ganesha to match 60.nfsMartin Schwenke2012-05-161-0/+31
| | | | | | | | | Originally from Srikrishan Malik <srikrishan.malik@in.ibm.com> with some style changes by me. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 637cab6304dae66b85668506028c76ea1ee88980)
* Eventscript functions: add optional version to nfs_check_rpc_service()Martin Schwenke2012-05-161-3/+9
| | | | | | | | | This can be optional because the 1st item of each action-triple is a test comparison that starts with '-'. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 92f74fd589467b46c758e116e97417edfe8773d7)
* Eventscript functions - no longer require interface_modify.shMartin Schwenke2012-03-221-33/+73
| | | | | | | | | Make add_ip_to_iface() and delete_ip_from_iface() do their own locking so the external script is no longer required. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 93f90caf91246074d9359bf31a39b26212cccc42)
* Eventscript functions - remove now-unused route/IP re-add script logicMartin Schwenke2012-03-221-24/+0
| | | | | | | | This is no longer used by 13.per_ip_routing or anything else. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 2a2ea6c61a05af2d0765e964abcc7ef04047431e)
* Eventscript functions - remove functions only used by 13.per_ip_routingMartin Schwenke2012-03-221-64/+0
| | | | | | | | The relevant functions are now in that script. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 45c3476d12bf0f52966b72d286f101fce1382cd2)
* Eventscript functions - add new function die()Martin Schwenke2012-03-221-0/+9
| | | | | | | | | | | | Args: 1. Error message to be printed. 2. Option exit code (default 1) Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 97b0c138cb97e30db27c40b4ee1481109ae90c78)
* config/functions: CTDB_VARDIR is /var/lib/ctdb on Debian-like systemsMathieu Parent2011-11-081-1/+5
| | | | (This used to be ctdb commit 56160eccb62178f645b017b1257677a1e854b2bc)
* apache's service name is not always httpdMathieu Parent2011-10-121-0/+1
| | | | | | Solution 2 of <https://bugzilla.samba.org/show_bug.cgi?id=8317> (This used to be ctdb commit 8b9ac5cd8d867ff4866ac464c570d9293d03a91e)
* Eventscripts - enhance ctdb_replay_monitor_status()Martin Schwenke2011-08-311-3/+31
| | | | | | | | | | | | | | | | Print useful output and return a suitable exit code. The DISABLED and TIMEDOUT statuses use fake negative return codes, and these can't be faked from the shell. So we map DISABLED to OK and TIMEDOUT to ERROR - this should avoid nearly all surprises. When we do this we add a note to the beginning of the output. The alternative is to "fix" ctdbd to use only codes that can actually be returned by shell scripts. However, the reason for using negative codes is probably to distinguish them from real ones... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit dda44d026e0c1b02feb02185b8c200a542be341a)
* Eventscripts - use ctdb scriptstatus -Y when replaying statusMartin Schwenke2011-08-301-2/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 5be904fb1fbd546618d25509b41ab836db62a70a)