1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-26 18:50:30 +03:00

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)
This commit is contained in:
Ronnie Sahlberg 2010-02-11 11:32:22 +11:00
parent 7f2f7364ad
commit 70c1e39e64

View File

@ -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" ] || {