Skip to contentSkip to conversation

init: drop GNU-isms for sleep command

PATCH In review Doug Goldstein 3 participants 5 messages May 5, 2016 – May 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 init: drop GNU-isms for sleep command

Most implementations of the sleep command only take integers. GNU coreutils has a GNU extension to allow any floating point number to be passed but we shouldn't depend on that.

---
 tools/hotplug/Linux/block-iscsi               | 2 +-
 tools/hotplug/Linux/init.d/xencommons.in      | 4 ++--
 tools/hotplug/Linux/init.d/xendriverdomain.in | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
tools/hotplug/Linux/block-iscsi +1 -1
index 8e36852..3615905 100644
@@ -74,7 +74,7 @@ find_device()
 {
     count=0
     while [ ! -e /dev/disk/by-path/*"$iqn"-lun-0 ]; do
-        sleep 0.1
+        sleep 1
         count=`expr $count + 1`
         if [ count = 100 ]; then
             # 10s timeout while waiting for iSCSI disk to settle
tools/hotplug/Linux/init.d/xencommons.in +2 -2
index 21e9133..eeac8ab 100644
@@ -107,14 +107,14 @@ do_stop () {
         echo Stopping xenconsoled
 	if read 2>/dev/null <$XENCONSOLED_PIDFILE pid; then
 		kill $pid
-		while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
+		while kill -9 $pid >/dev/null 2>&1; do sleep 1; done
 		rm -f $XENCONSOLED_PIDFILE
 	fi
 
 	echo Stopping QEMU
 	if read 2>/dev/null <$QEMU_PIDFILE pid; then
 		kill $pid
-		while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
+		while kill -9 $pid >/dev/null 2>&1; do sleep 1; done
 		rm -f $QEMU_PIDFILE
 	fi
 
tools/hotplug/Linux/init.d/xendriverdomain.in +1 -1
index dd5f3a3..3720dea 100644
@@ -56,7 +56,7 @@ do_stop () {
         echo Stopping xl devd...
 	if read 2>/dev/null <$XLDEVD_PIDFILE pid; then
 		kill $pid
-		while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
+		while kill -9 $pid >/dev/null 2>&1; do sleep 1; done
 		rm -f $XLDEVD_PIDFILE
 	fi
 }
Signature · 7 lines
2.7.3


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw

PATCH 2/2 init: shebang should be the first line

The shebang was not on the first line in the init script and it should be.

---
 tools/hotplug/Linux/init.d/xendriverdomain.in | 1 -
 1 file changed, 1 deletion(-)
tools/hotplug/Linux/init.d/xendriverdomain.in +0 -1
index 3720dea..5fd4e9a 100644
@@ -1,4 +1,3 @@
-
 #!/bin/bash
 #
 # xendriverdomain    Script to start services needed in a Xen driver domain
Signature · 7 lines
2.7.3


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Reviewed-by on v1 1/2
#3 lore raw
In reply to Doug Goldstein
Quoted 5 lines · Doug Goldstein

Most implementations of the sleep command only take integers. GNU coreutils has a GNU extension to allow any floating point number to be passed but we shouldn't depend on that.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel