WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] xendomains init script

To: Xen development list <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] xendomains init script
From: Florian Kirstein <xenlist@xxxxxxxxxxxxxx>
Date: Wed, 28 Feb 2007 06:20:23 +0100
Delivery-date: Tue, 27 Feb 2007 21:19:36 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060331062717.D26981@xxxxxxxxxxx>; from xenlist@xxxxxxxxxxxxxx on Fri, Mar 31, 2006 at 06:27:17AM +0200
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20051019094439.GQ8705@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20060330060933.C26981@xxxxxxxxxxx> <20060330212128.GQ14102@xxxxxxxxxx> <20060331062717.D26981@xxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
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
<Prev in Thread] Current Thread [Next in Thread>