Add new comment

Submitted by bendix (registered user) on Thu, 2008-07-10 14:59.

Very nice guide! Here is a little addition: 

During system boot and shutdown I get several complaints from /etc/init.d/xendomains due to missing quotes in test statements. In one line there is a duplicate call of "cut". Here is a patch to quieten this:

 root@unics:~# diff -uN xendomains.orig xendomains.new
--- xendomains.orig     2008-07-10 15:48:13.000000000 +0200
+++ xendomains.new      2008-07-10 15:51:53.000000000 +0200
@@ -63,7 +63,7 @@
        echo_rc()
        {
            #echo -n "  [${_SMSG[${_RC_RV}]}] "
-           if test ${_RC_RV} = 0; then
+           if test "${_RC_RV}" = "0"; then
                success "  [${_SMSG[${_RC_RV}]}] "
            else
                failure "  [${_SMSG[${_RC_RV}]}] "
@@ -80,7 +80,7 @@
         else
          echo_rc()
          {
-           if test ${_RC_RV} = 0; then
+           if test "${_RC_RV}" = "0"; then
                log_success_msg "  [${_SMSG[${_RC_RV}]}] "
            else
                log_failure_msg "  [${_SMSG[${_RC_RV}]}] "
@@ -183,7 +183,7 @@
 {
     name=`echo "$1" | cut -d\  -f1`
     name=${name%% *}
-    rest=`echo "$1" | cut cut -d\  -f2-`
+    rest=`echo "$1" | cut -d\  -f2-`
     read id mem cpu vcpu state tm < <(echo "$rest")
 }
 
@@ -193,7 +193,7 @@
     RC=1
     while read LN; do
        parseln "$LN"
-       if test $id = 0; then continue; fi
+       if test "$id" = "0"; then continue; fi
        case $name in
            ($NM)
                RC=0
@@ -268,7 +268,7 @@
 {
     while read LN; do
        parseln "$LN"
-       if test $id = 0; then continue; fi
+       if test "$id" = "0"; then continue; fi
        if test "$state" != "-b---d" -a "$state" != "-----d"; then
            return 1;
        fi
@@ -310,7 +310,7 @@
     echo -n "Shutting down Xen domains:"
     while read LN; do
        parseln "$LN"
-       if test $id = 0; then continue; fi
+       if test "$id" = "0"; then continue; fi
        echo -n " $name"
        if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
            case $name in

Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.

Reply

*
*
The content of this field is kept private and will not be shown publicly.


*

  • Images can be added to this post.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <div>
  • Lines and paragraphs break automatically.