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

[Xen-changelog] [xen-4.1-testing] tools: init.d/Linux/xencommons: run script only when needed



# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1323363016 0
# Node ID 7a4fad2d4b05612b6064ee1926deed159de777fe
# Parent  d9f8316a829175bbc884d360568d5749c9ad840b
tools: init.d/Linux/xencommons: run script only when needed

Currently xencommons prints an error that /proc/xen/capabilities does
not exist when started on a non-xen kernel.

Update the xencommons script to run only when needed:
- do not run if /proc/xen does not exist
- check if /proc/xen/capabilities exists before doing the grep for dom0

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

xen-unstable changeset: 24333:4002e63b188a
Backport-requested-by: Olaf Hering <olaf@xxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r d9f8316a8291 -r 7a4fad2d4b05 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons     Tue Dec 06 10:53:12 2011 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons     Thu Dec 08 16:50:16 2011 +0000
@@ -29,15 +29,24 @@
 XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid
 shopt -s extglob
 
+# not running in Xen dom0 or domU
+if ! test -d /proc/xen ; then
+       exit 0
+fi
+
+# mount xenfs in dom0 or domU with a pv_ops kernel
 if test "x$1" = xstart && \
-     test -d /proc/xen && \
    ! test -f /proc/xen/capabilities && \
    ! grep '^xenfs ' /proc/mounts >/dev/null;
 then
        mount -t xenfs xenfs /proc/xen
 fi
 
-if ! grep -q "control_d" /proc/xen/capabilities ; then
+# run this script only in dom0:
+# no capabilities file in xenlinux domU kernel
+# empty capabilities file in pv_ops domU kernel
+if test -f /proc/xen/capabilities && \
+   ! grep -q "control_d" /proc/xen/capabilities ; then
        exit 0
 fi
 

_______________________________________________
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®.