ia64/xen-unstable

changeset 14185:d2646466e0a7

Fix init.d/xendomains startup script so log_error and log_success
will also work on redhat-based distributions before RHEL 5. See
discussion "xendomains init script" about a year ago on xen-devel.

Signed-off-by: Florian Kirstein <ray@ray.net>
author kfraser@localhost.localdomain
date Wed Feb 28 18:06:56 2007 +0000 (2007-02-28)
parents c3c03089c59e
children d66dff09338a
files tools/examples/init.d/xendomains
line diff
     1.1 --- a/tools/examples/init.d/xendomains	Wed Feb 28 17:55:19 2007 +0000
     1.2 +++ b/tools/examples/init.d/xendomains	Wed Feb 28 18:06:56 2007 +0000
     1.3 @@ -58,18 +58,7 @@ else
     1.4  	_SMSG=(done failed failed missed failed skipped unused failed failed)
     1.5  	_RC_UNUSED=6
     1.6      fi
     1.7 -    if test -e /lib/lsb/init-functions; then
     1.8 -	# LSB    
     1.9 -    	. /lib/lsb/init-functions
    1.10 -	echo_rc()
    1.11 -	{
    1.12 -	    if test ${_RC_RV} = 0; then
    1.13 -		log_success_msg "  [${_SMSG[${_RC_RV}]}] "
    1.14 -	    else
    1.15 -		log_failure_msg "  [${_SMSG[${_RC_RV}]}] "
    1.16 -	    fi
    1.17 -	}
    1.18 -    elif test -e /etc/init.d/functions; then
    1.19 +    if test -e /etc/init.d/functions; then
    1.20  	# REDHAT
    1.21  	. /etc/init.d/functions
    1.22  	echo_rc()
    1.23 @@ -81,6 +70,24 @@ else
    1.24  		failure "  [${_SMSG[${_RC_RV}]}] "
    1.25  	    fi
    1.26  	}
    1.27 +    elif test -e /lib/lsb/init-functions; then
    1.28 +	# LSB    
    1.29 +    	. /lib/lsb/init-functions
    1.30 +        if alias log_success_msg >/dev/null 2>/dev/null; then
    1.31 +	  echo_rc()
    1.32 +	  {
    1.33 +	       echo "  [${_SMSG[${_RC_RV}]}] "
    1.34 +	  }
    1.35 +        else
    1.36 +	  echo_rc()
    1.37 +	  {
    1.38 +	    if test ${_RC_RV} = 0; then
    1.39 +		log_success_msg "  [${_SMSG[${_RC_RV}]}] "
    1.40 +	    else
    1.41 +		log_failure_msg "  [${_SMSG[${_RC_RV}]}] "
    1.42 +	    fi
    1.43 +	  }
    1.44 +        fi
    1.45      else    
    1.46  	# emulate it
    1.47  	echo_rc()