diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2010-02-11 11:32:22 +1100 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2010-02-16 11:01:39 +1100 |
commit | 70c1e39e64b713998cd5f2bc72a09e903a538487 (patch) | |
tree | 6acec52613a302d0a1cfae29ae8c31b54f6780b2 /ctdb | |
parent | 7f2f7364ade17b18334dda5f9c72ad4600abcd9c (diff) | |
download | samba-70c1e39e64b713998cd5f2bc72a09e903a538487.tar.gz samba-70c1e39e64b713998cd5f2bc72a09e903a538487.tar.xz samba-70c1e39e64b713998cd5f2bc72a09e903a538487.zip |
Add a variable CTDB_CHECK_SWAP_IS_NOT_USED="yes"
to control whether or not to check if we are swapping, and produce
useful output into the logfile if we are.
For production systems with dedicated nas-heads we should never swap.
But for developer/test systems we often use smaller nondedicated systems where
we can no longer guarantee that we will not be using swap.
(This used to be ctdb commit db87849bf3380914a63a626412bec209dbea7d20)
Diffstat (limited to 'ctdb')
-rwxr-xr-x | ctdb/config/events.d/00.ctdb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ctdb/config/events.d/00.ctdb b/ctdb/config/events.d/00.ctdb index ed8f9f2126..03310b7c20 100755 --- a/ctdb/config/events.d/00.ctdb +++ b/ctdb/config/events.d/00.ctdb @@ -30,11 +30,13 @@ case "$1" in monitor) # We should never enter swap, so SwapTotal == SwapFree. - if [ -n "`grep '^Swap\(Total\|Free\)' /proc/meminfo | uniq -s 10 -u`" ]; then - echo We are swapping: - cat /proc/meminfo - ps auxfww - fi + [ "$CTDB_CHECK_SWAP_IS_NOT_USED" = "yes" ] && { + if [ -n "`grep '^Swap\(Total\|Free\)' /proc/meminfo | uniq -s 10 -u`" ]; then + echo We are swapping: + cat /proc/meminfo + ps auxfww + fi + } # monitor that we are not running out of memory [ -z "$CTDB_MONITOR_FREE_MEMORY" ] || { |