Skip to contentSkip to conversation

xend: prompt user start xencommons

PATCH In review Yu Zhiguo 2 participants 3 messages Jun 22, 2010 – Jun 23, 2010

lore
Share & tools
lore

Yu Zhiguo

author
#0 lore raw

PATCH 1/1 xend: prompt user start xencommons

prompt user start xencommons first if it is not running.

tools/hotplug/Linux/init.d/xend +5 -0
diff -r be32d4fe1e8a -r 139ec4ec4067 tools/hotplug/Linux/init.d/xend
@@ -37,6 +37,11 @@
 
 case "$1" in
   start)
+	service xencommons status >/dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		echo "xencommons should be started first."
+		exit 1
+	fi
 	mkdir -p /var/lock/subsys
 	touch /var/lock/subsys/xend
 	xend start
#1 lore raw

Yu Zhiguo writes ("[Xen-devel] [PATCH] xend: prompt user start xencommons"):

Quoted 1 line

prompt user start xencommons first if it is not running.

This isn't portable. The "service" command is not available on all distributions.

Perhaps a better check would be to see if xenstored is running, by
calling xenstore-read -s / or some such ?

Ian.

author
#2 lore raw

Hi Ian

Quoted 6 lines · Ian Jackson

Yu Zhiguo writes ("[Xen-devel] [PATCH] xend: prompt user start xencommons"):

Quoted 1 line

prompt user start xencommons first if it is not running.

This isn't portable. The "service" command is not available on all distributions.

Indeed.

Quoted 3 lines

Perhaps a better check would be to see if xenstored is running, by
calling xenstore-read -s / or some such ?

I'd like to check xenconsoled rather than xenstored is running or not to determine xencommons status, because xenconsoled can be killed when stop xencommons.

----------------------

prompt user start xencommons first if it is not running.

tools/hotplug/Linux/init.d/xend +4 -0
diff -r a24dbfcbdf69 -r ee71d51a0437 tools/hotplug/Linux/init.d/xend
@@ -37,6 +37,10 @@
 
 case "$1" in
   start)
+	if [ -z "`ps -C xenconsoled -o pid=`" ]; then
+		echo "xencommons should be started first."
+		exit 1
+	fi
 	mkdir -p /var/lock/subsys
 	touch /var/lock/subsys/xend
 	xend start