summaryrefslogtreecommitdiffstats
path: root/ctdb/server/eventscript.c
Commit message (Collapse)AuthorAgeFilesLines
...
* we only need to switch into client mode from the eventscript child if we are ↵Ronnie Sahlberg2009-04-061-9/+10
| | | | | | running the monitor event (This used to be ctdb commit 13e2c9044950f21918e4610726e73ed3d8f76920)
* use _exit() and not exit() when we terminate a failed eventscript child processRonnie Sahlberg2009-04-061-1/+1
| | | | (This used to be ctdb commit 33b296cee177adc61edc911caec8c24b3efa8441)
* add a new command "ctdb scriptstatus"root2009-03-231-3/+302
| | | | | | | | | | | | | | | | | | | | | | | | | this command shows which eventscripts were executed during the last monitoring cycle and the status from each eventscript. If an eventscript timedout or returned an error we also show the output from the eventscript. Example : [root@rcn1 ctdb-git]# ./bin/ctdb scriptstatus 6 scripts were executed last monitoring cycle 00.ctdb Status:OK Duration:0.021 Mon Mar 23 19:04:32 2009 10.interface Status:OK Duration:0.048 Mon Mar 23 19:04:32 2009 20.multipathd Status:OK Duration:0.011 Mon Mar 23 19:04:33 2009 40.vsftpd Status:OK Duration:0.011 Mon Mar 23 19:04:33 2009 41.httpd Status:OK Duration:0.011 Mon Mar 23 19:04:33 2009 50.samba Status:ERROR Duration:0.057 Mon Mar 23 19:04:33 2009 OUTPUT:ERROR: Samba tcp port 445 is not responding Add a new helper function "switch_from_server_to_client()" which both the recovery daemon can use as well as in the child process we start for running the actual eventscripts. Create several new controls, both for the eventscript child process to inform the master daemon of the current status of the scripts as well as for the ctdb tool to extract this information from the runninc daemon. (This used to be ctdb commit c98f90ad61c9b1e679116fbed948ddca4111968d)
* add a context and a timed event so that once we have been in recoveryRonnie Sahlberg2008-10-221-3/+3
| | | | | | mode for too long we drop all public ip addresses (This used to be ctdb commit 403c68f96e1380dd07217c688de2730464f77ea0)
* allow multiple eventscripts using the same prefix.Ronnie Sahlberg2008-10-161-8/+4
| | | | | | this eases the pain for users that use out of tree eventscripts (This used to be ctdb commit 8313dfb6fc5404cd2d065af6620412f8664ada11)
* Do not allow "ctdb eventscript" to start new eventscripts while we are in ↵Ronnie Sahlberg2008-07-171-0/+5
| | | | | | recovery mode (This used to be ctdb commit 8140825e1d06053a900fd0adf0a150622c0fc146)
* Fix a very subtle race where we could get a double free of a tallocedRonnie Sahlberg2008-07-111-4/+9
| | | | | | | | | | memory if ctdb_run_eventscript() would be called during processing of ctdb_event_script_timeout() for user unvoked eventscripts. (eventsccripts invoked by "ctdb eventscript ...") Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> (This used to be ctdb commit 15bc66ae801b0c69a65a7a2acf5df151e76edc2a)
* proper waitpid() fix.Ronnie Sahlberg2008-07-091-9/+11
| | | | | | remove all waitpid() calls and use the event system to trap sigchld (This used to be ctdb commit 77458b2b6b51b2970c12b0e5b097088d3fb9d358)
* Revert "waitpid() can block if it takes a long time before the child terminates"Ronnie Sahlberg2008-07-081-18/+8
| | | | | | | | | This reverts commit bfba5c7249eff8a10a43b53c1b89dd44b625fd10. revert the waitpid changes. we need to waitpid for some childredn so should refactor the approach completely (This used to be ctdb commit 702ced6c2fe569c01fe96c60d0f35a7e61506a96)
* waitpid() can block if it takes a long time before the child terminatesRonnie Sahlberg2008-07-081-8/+18
| | | | | | | | | | | | so we should not call it from the main daemon. 1, set SIGCHLD to SIG_DFL to make sure we ignore this signal 2, get rid of all waitpid() calls 3, change reporting of event script status code from _exit()/waitpid() to write()/read() one byte across the pipe. (This used to be ctdb commit bfba5c7249eff8a10a43b53c1b89dd44b625fd10)
* use more libral handling of event scripts timing out.Ronnie Sahlberg2008-07-071-7/+25
| | | | | | | | | If the event script that timed out was for the "monitor" event, then even if it timed out we still return SUCCESS back to the guy invoking the eventscript. Only consider the eventscript for "monitor" to have failed with an error IFF it actually terminated with an error, or if it timed out 5 times in a row and hung. (This used to be ctdb commit 60f3c04bd8b20ecbe937ffed08875cdc6898b422)
* if the event scripts hangs EventScriptsBanCount consecutive times in a rowRonnie Sahlberg2008-06-131-2/+31
| | | | | | the node will ban itself for the default recovery ban period (This used to be ctdb commit 7239d7ecd54037b11eddf47328a3129d281e7d4a)
* when a eventscript has timed out, log the event options (i.e. "monitor" ↵Ronnie Sahlberg2008-06-131-15/+17
| | | | | | | | "takeip 1.2..." etc) to the log (This used to be ctdb commit dbe31581abf35fc4a32d3cbf487dd34e2b9c937a)
* put the return in the right placeAndrew Tridgell2008-05-141-1/+1
| | | | | | We were refusing the 'startrecovery' event (This used to be ctdb commit 788d38812d73729f11d12e9812b16092c0ae4123)
* Fix the chicken and egg problem with ctdb/samba and a registry smb.confAndrew Tridgell2008-05-141-6/+18
| | | | | | | | | | | | | | | | | | | | This attempts to fix the problem of ctdb event scripts blocking due to attempted access to the ctdb databases during recovery. The changes are: - now only the 'shutdown' and 'startrecovery' events can be called with the databases locked in recovery. The event scripts must ensure that for these two events no database access is attempted - the recovered, takeip and releaseip events could previously be called inside a recovery. The code now ensures that this doesn't happen, delaying the events till after recovery has finished - the 50.samba event script now avoids using testparm unless it is really needed This needs extensive testing. (This used to be ctdb commit e3cdb8f2be6a44ec877efcd75c7297edb008a80b)
* add a mechanism to force a node to run the eventscripts with arbitrary argumentsRonnie Sahlberg2008-04-021-0/+74
| | | | | | ctdb eventscript "command argument argument ..." (This used to be ctdb commit 118a16e763d8332c6ce4d8b8e194775fb874c8c8)
* merge from ronnieAndrew Tridgell2008-02-041-10/+10
| | | | (This used to be ctdb commit e7b57d38cf7255be823a223cf15b7526285b4f1c)
* added debug constants to allow for better mapping to syslog levelsAndrew Tridgell2008-02-041-1/+1
| | | | (This used to be ctdb commit 7ba8f1dde318eab03f4257e5a89fd23e7281e502)
* change how we do public addresses and takeover so that we can have Ronnie Sahlberg2007-09-041-6/+6
| | | | | | | | | | | | | 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)
* add an extra debug statement when we send a SIGTERM to a processRonnie Sahlberg2007-08-271-0/+1
| | | | (This used to be ctdb commit a9c1be9cf9efdc69bfc95657b70e9f8b8230cda8)
* make sure that the event script is executable and just ignore it Ronnie Sahlberg2007-08-211-0/+13
| | | | | | othervise (This used to be ctdb commit 65eb7845c70489d654acaaf99cd2c8eac7df11dc)
* removed redundent debug messageAndrew Tridgell2007-08-201-1/+1
| | | | (This used to be ctdb commit 9ee742b7cc43be7da6b568308912a3f2cfe4f4d3)
* merged new event script calling code from ronnnieAndrew Tridgell2007-08-201-17/+132
|\ | | | | | | (This used to be ctdb commit bbacad61b3eee4276ffe44ed2a23949aca8152cf)
| * add text to the event script timeout log on how to find out which script Ronnie Sahlberg2007-08-151-1/+1
| | | | | | | | | | | | timed out (This used to be ctdb commit bd6db995fb00ed45c5f0a50bbe6cf5d0fe22a194)
| * change the now rather small /etc/ctdb/events script into a service Ronnie Sahlberg2007-08-151-35/+0
| | | | | | | | | | | | | | | | specific script /etc/ctdb/events.d/00.ctdb get rid of CTDB_EVENTS_SCRIPT and --event-script (This used to be ctdb commit 81ccfaf838e5772d4a58eb6a70224b7b39aba9f3)
| * add a comment that the talloc_free also removes the script from the treeRonnie Sahlberg2007-08-151-0/+1
| | | | | | | | (This used to be ctdb commit ce71f6e9cf983cc4fe66935ad6c18d55dfed03a5)
| * call the service specific event scripts directly from the forked child Ronnie Sahlberg2007-08-151-8/+122
| | | | | | | | | | | | | | instead for from /etc/ctdb/events so that we can get better debugging output in the logs when something fails in the scripts (This used to be ctdb commit 4ed96b768aea1611e8002f7095d3c4d12ccf77a3)
| * comment that ctdb_event_script_v() is called from a forked childs Ronnie Sahlberg2007-08-151-0/+2
|/ | | | | | context and thus can make blocking calls (This used to be ctdb commit b31d98281f15995ad340d2510e08e04ed46e271a)
* make sure we still run events when waiting for ctdb_event_script()Andrew Tridgell2007-07-191-25/+72
| | | | (This used to be ctdb commit 05efbfe9ff9691c1d7441e7b9855aed25791faf0)
* fully save/restore scheduler parametersAndrew Tridgell2007-07-131-1/+1
| | | | (This used to be ctdb commit 59408eabe7515d49a6eef3b6fb2590a1cd1df956)
* added --nosetsched option to ctdbdAndrew Tridgell2007-07-131-1/+3
| | | | (This used to be ctdb commit 4cbbb88c1735c7d112e751e22da1c1c69e09bf4a)
* update lib/replace from samba4Andrew Tridgell2007-07-101-3/+2
| | | | (This used to be ctdb commit f0555484105668c01c21f56322992e752e831109)
* forgot to add thisAndrew Tridgell2007-07-041-0/+192
(This used to be ctdb commit 30fc56b7489e42633532964096e53faee1319dde)