[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Fix init.d/xendomains startup script so log_error and log_success



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1172686016 0
# Node ID d2646466e0a7352ebc11f3277d51d99f737d0fd3
# Parent  c3c03089c59ef515766636dd4afef6573f3b6b42
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@xxxxxxx>
---
 tools/examples/init.d/xendomains |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff -r c3c03089c59e -r d2646466e0a7 tools/examples/init.d/xendomains
--- a/tools/examples/init.d/xendomains  Wed Feb 28 17:55:19 2007 +0000
+++ b/tools/examples/init.d/xendomains  Wed Feb 28 18:06:56 2007 +0000
@@ -58,18 +58,7 @@ else
        _SMSG=(done failed failed missed failed skipped unused failed failed)
        _RC_UNUSED=6
     fi
-    if test -e /lib/lsb/init-functions; then
-       # LSB    
-       . /lib/lsb/init-functions
-       echo_rc()
-       {
-           if test ${_RC_RV} = 0; then
-               log_success_msg "  [${_SMSG[${_RC_RV}]}] "
-           else
-               log_failure_msg "  [${_SMSG[${_RC_RV}]}] "
-           fi
-       }
-    elif test -e /etc/init.d/functions; then
+    if test -e /etc/init.d/functions; then
        # REDHAT
        . /etc/init.d/functions
        echo_rc()
@@ -81,6 +70,24 @@ else
                failure "  [${_SMSG[${_RC_RV}]}] "
            fi
        }
+    elif test -e /lib/lsb/init-functions; then
+       # LSB    
+       . /lib/lsb/init-functions
+        if alias log_success_msg >/dev/null 2>/dev/null; then
+         echo_rc()
+         {
+              echo "  [${_SMSG[${_RC_RV}]}] "
+         }
+        else
+         echo_rc()
+         {
+           if test ${_RC_RV} = 0; then
+               log_success_msg "  [${_SMSG[${_RC_RV}]}] "
+           else
+               log_failure_msg "  [${_SMSG[${_RC_RV}]}] "
+           fi
+         }
+        fi
     else    
        # emulate it
        echo_rc()

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.