From b8cc203a3b956e3e7c5a1522d2b227c947a4586c Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Thu, 26 Mar 2009 22:01:40 +0100 Subject: [PATCH 07/15] Added debian-like LSB functions --- config/ctdb.init | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/config/ctdb.init b/config/ctdb.init index ed6d990..2869f88 100755 --- a/config/ctdb.init +++ b/config/ctdb.init @@ -28,6 +28,52 @@ DESC="Clustered TDB" test -x $DAEMON || exit 0 +#LSB +if [ -f /lib/lsb/init-functions ] ; then + . /lib/lsb/init-functions +fi +if ! type 'log_daemon_msg' >/dev/null; then + log_daemon_msg () { + if [ -z "${1:-}" ]; then + return 1 + fi + + if [ -z "${2:-}" ]; then + echo -n "$1:" + return + fi + + echo -n "$1: $2" + } +fi +if ! type 'log_progress_msg' >/dev/null; then + log_progress_msg () { + if [ -z "${1:-}" ]; then + return 1 + fi + echo -n " $@" + } +fi +if ! type 'log_end_msg' >/dev/null; then + log_end_msg () { + # If no arguments were passed, return + if [ -z "${1:-}" ]; then + return 1 + fi + + retval=$1 + + if [ $1 -eq 0 ]; then + echo "." + elif [ $1 -eq 255 ]; then + /bin/echo -e " (warning)." + else + /bin/echo -e " failed!" + fi + return $retval + } +fi + # Source function library. if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions -- 1.6.2