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

Re: [Xen-devel] xendomains init script


  • To: Xen development list <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Florian Kirstein <xenlist@xxxxxxxxxxxxxx>
  • Date: Wed, 28 Feb 2007 06:20:23 +0100
  • Delivery-date: Tue, 27 Feb 2007 21:19:36 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi,

replying to my almost a year old message:
> The patch works for xen 3.0.1 (and newer, possibly some older)
... I've finally build this as patch for current xen-unstable.hg.
RedHat followed the suggestion to reimplement LSB compatibility in
RHEL5, but for all the others (including FC6) this patch still is
needed. It's also referenced as solution in 
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=171056
and I'm using it since I first posted it on all my xen builds, don't
see problems there, should not harm non-redhat dists.

(:ul8er, r@y

# HG changeset patch
# User ray@xxxxxxxxxxxxx
# Node ID a96bf6276e4fa1323a0ffe260f0029018b57dfda
# Parent  1c5e6239a8d0381fdbf56d4926f986d7f0ec07c0
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>

diff -r 1c5e6239a8d0 -r a96bf6276e4f tools/examples/init.d/xendomains
--- a/tools/examples/init.d/xendomains  Sun Feb 25 23:58:33 2007 -0600
+++ b/tools/examples/init.d/xendomains  Wed Feb 28 06:08:20 2007 +0100
@@ -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()

Attachment: xendomains.patch
Description: Text document

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

 


Rackspace

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