diff options
-rwxr-xr-x | ctdb/config/functions | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ctdb/config/functions b/ctdb/config/functions index 26b282aa99..c6cddd462d 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -68,6 +68,20 @@ ctdb_set_current_debuglevel () . "$_f" } +debug () +{ + if [ $CTDB_CURRENT_DEBUGLEVEL -ge 4 ] ; then + # If there are arguments then echo them. Otherwise expect to + # use stdin, which allows us to pass lots of debug using a + # here document. + if [ -n "$1" ] ; then + echo "DEBUG: $*" + elif ! tty -s ; then + sed -e 's@^@DEBUG: @' + fi + fi +} + ############################################################## # determine on what type of system (init style) we are running detect_init_style() { @@ -1125,6 +1139,11 @@ update_tickles () done } +# We'll call this here to ensure $CTDB_CURRENT_DEBUGLEVEL is set. +# This gives us a chance to override the debug level using a file in +# $CTDB_BASE/rc.local.d/. +ctdb_set_current_debuglevel + script_name="${0##*/}" # basename service_name="$script_name" # default is just the script name service_fail_limit=1 |