added some '>&2'
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 5 Mar 2004 17:56:40 +0000 (17:56 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 5 Mar 2004 17:56:40 +0000 (17:56 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1105 94cd875c-1c1d-0410-91d2-eb244daf1a30

24 files changed:
util-vserver/scripts/chcontext
util-vserver/scripts/functions
util-vserver/scripts/rootshell
util-vserver/scripts/vapt-get
util-vserver/scripts/vapt-get-worker
util-vserver/scripts/vpkg
util-vserver/scripts/vpstree
util-vserver/scripts/vrpm
util-vserver/scripts/vrpm-preload
util-vserver/scripts/vrpm-worker
util-vserver/scripts/vserver
util-vserver/scripts/vserver-build
util-vserver/scripts/vserver-build.apt-rpm
util-vserver/scripts/vserver-build.debootstrap
util-vserver/scripts/vserver-build.functions
util-vserver/scripts/vserver-build.functions.pkgmgmt
util-vserver/scripts/vserver-build.skeleton
util-vserver/scripts/vserver-copy
util-vserver/scripts/vserver.functions
util-vserver/scripts/vserver.start
util-vserver/scripts/vserver.stop
util-vserver/scripts/vservers.grabinfo.sh
util-vserver/scripts/vsysvwrapper
util-vserver/scripts/vtop

index dded01f..41f1582 100755 (executable)
@@ -18,7 +18,7 @@
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
@@ -134,7 +134,7 @@ while true; do
        --secure)       OPT_SECURE=1;;
        --silent)       OPT_SILENT=1;;
        --)             shift; break;;
-       *)              echo $"chcontext: internal error; arg=='$1'"; exit 1;;
+       *)              echo $"chcontext: internal error; arg=='$1'" >&2; exit 1;;
     esac
     shift
 done
@@ -146,13 +146,13 @@ trap "cleanup" EXIT
 xid=$($_VCONTEXT --create ${OPT_SILENT:+--silent} ${OPT_CTX:+--xid "$OPT_CTX"} -- $_CTX_KEEP_ALIVE --socket "$tmpdir"/socket --timeout 60)
 rc=$?
 test "$rc" -ne 255 ||
-    echo $"chcontext: Failed to create the context; aborting..."
+    echo $"chcontext: Failed to create the context; aborting..." >&2
     exit 1
 }
 
 test "$rc" -ne 254 || xid=$OPT_CTX
 test "$xid" || {
-    echo $"chcontext: Failed to determine context xid; aborting..."
+    echo $"chcontext: Failed to determine context xid; aborting..." >&2
     exit 1
 }
 
index 21e2991..4ff4e41 100644 (file)
@@ -87,7 +87,7 @@ function _pkgSetVarsBase
                test -d "$PKGDIR" || {
                    echo "Can not find configuration-directory for package-managment tools"
                    exit 1
-               }
+               } >&2
                findDir EXECDIR      $PKGDIR/execdir     /
            else
                VDIR=$(getPhysicalDir "$vserver")
@@ -99,7 +99,7 @@ function _pkgSetVarsBase
            test -d "$BASEDIR" || {
                echo "Can not find configuration-directory"
                exit 1
-           }
+           } >&2
            
            VDIR=$BASEDIR/vdir
            test -d "$VDIR"   || VDIR=$DEFAULT_VSERVERDIR/$vserver
@@ -109,7 +109,7 @@ function _pkgSetVarsBase
            test -d "$PKGDIR" || {
                echo "Can not find configuration-directory for package-managment tools"
                exit 1
-           }
+           } >&2
 
            findDir EXECDIR      $PKGDIR/execdir     /
 
@@ -216,7 +216,7 @@ function pkgInit
        case "$i" in
            rpm)        _pkgSetVarsRPM;;
            apt)        _pkgSetVarsApt;;
-           *)          echo "Unknown packaging flavor"; exit 1;;
+           *)          echo "Unknown packaging flavor" >&2; exit 1;;
        esac
     done
 
@@ -335,7 +335,7 @@ function checkComponents
            build)      test -x "$_VSERVER_BUILD"    || failed=1;;
            sysv)       test -x "$INITRDDIR/vserver" || failed=1;;
            devel)      test -d "$INCLUDEDIR/vserver.h" || failed=1;;
-           *)          echo "Unknown component '$i'"
+           *)          echo "Unknown component '$i'" >&2
                        return false
                        ;;
        esac
@@ -343,7 +343,7 @@ function checkComponents
        test -z "$failed" || {
            echo "$msg: $i"
            x_failed=1
-       }
+       } >&2
     done
 
     test -z "$x_failed"
index c0cfca7..b365391 100755 (executable)
@@ -18,7 +18,7 @@
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index 604ec16..ed1de7f 100755 (executable)
@@ -18,7 +18,7 @@
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index 2a60ea0..9161dcf 100755 (executable)
@@ -20,7 +20,7 @@ set -e
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index 0a54bf4..153fe55 100755 (executable)
@@ -18,7 +18,7 @@
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index 506e518..9a4f0c6 100755 (executable)
@@ -20,7 +20,7 @@
 #Presents the processes running in all virtual servers
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index 92aa7b9..86d6d1c 100755 (executable)
@@ -18,7 +18,7 @@
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index 55cce0e..1036e5c 100755 (executable)
@@ -20,7 +20,7 @@ set -e
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index a32e47b..b5694b6 100755 (executable)
@@ -20,7 +20,7 @@ set -e
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index 27bc37d..817d835 100755 (executable)
@@ -20,7 +20,7 @@
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
@@ -132,7 +132,7 @@ while true; do
        --silent)       OPTION_SILENT=$1;;
        ----nonamespace)OPTION_NONAMESPACE=$1;;
        --)             shift; break;;
-       *)              echo $"vserver: internal error; arg=='$1'"; exit 1;;
+       *)              echo $"vserver: internal error; arg=='$1'" >&2; exit 1;;
     esac
     shift
 done
@@ -162,7 +162,7 @@ if test "$allow_legacy"; then
     test -d "$VSERVER_DIR" -o ! -e "$CONFDIR/$vserver.conf" || do_legacy=1
 
     test -z "$do_legacy" || {
-       echo $"WARNING: can not find configuration, assuming legacy method"
+       echo $"WARNING: can not find configuration, assuming legacy method" >&2
        exec "$_VSERVER_LEGACY" "$@"
     }
 fi
@@ -170,7 +170,7 @@ fi
 test -d "$VSERVER_DIR" || {
     echo "Can not find vserver-setup"
     exit 1
-}
+} >&2
 
 if test -e "$VSERVER_DIR"/name; then
     read VSERVER_NAME <"$VSERVER_DIR"/name
@@ -245,7 +245,7 @@ case "$2" in
        fi
        ;;
     *)
-       echo $"Usage: $0 {start|stop|suexec|restart|condrestart|exec|enter|chkconfig|running|status}"
+       echo $"Usage: $0 {start|stop|suexec|restart|condrestart|exec|enter|chkconfig|running|status}" >&2
        exit 2
        ;;
 esac
index 463294f..c2e30e3 100755 (executable)
@@ -18,7 +18,7 @@
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
@@ -102,7 +102,7 @@ while true; do
        --)        shift; break;;
        *)
            { setup_setOption2 "$1" "$2" && shift; } || \
-           { echo $"vserver-build: internal error."; exit 1; }
+           { echo $"vserver-build: internal error."; exit 1; } >&2
            ;;
     esac
     shift
@@ -111,7 +111,7 @@ done
 test "$VSERVER_NAME" || {
     echo $"Name of vserver not specified"
     exit 1
-}
+} >&2
 
 setup_setDefaults "$VSERVER_NAME"
 
index ec6c3c5..230c801 100644 (file)
@@ -27,7 +27,7 @@ while true; do
        -d)             DISTRIBUTION=$2; shift;;
        --debug)        set -x;;
        --)             shift; break ;;
-       *)              echo "vserver-build.apt-rpm: internal error: unrecognized option '$1'"
+       *)              echo "vserver-build.apt-rpm: internal error: unrecognized option '$1'" >&2
                        exit 1
                        ;;
     esac
index df2eb9a..52dcd7a 100644 (file)
@@ -88,7 +88,7 @@ while true; do
        -m)             mirror=$2;       shift;;
        --debug)        set -x;;
        --)             shift; break ;;
-       *)              echo "vserver-build.skeleton: internal error: unrecognized option '$1'"
+       *)              echo "vserver-build.skeleton: internal error: unrecognized option '$1'" >&2
                        exit 1
                        ;;
     esac
index 6f0503e..b12a5d5 100644 (file)
@@ -79,7 +79,7 @@ function _setRootDir
     done
 
     test -d "$ROOTDIR" || {
-       echo "Root-directory '$ROOTDIR' does not exist or is invalid"
+       echo "Root-directory '$ROOTDIR' does not exist or is invalid" >&2
        exit 1
     }
 }
@@ -128,8 +128,9 @@ function getDistribution
        set -- $(cat /etc/debian_version)
        DISTRIBUTION=deb$1
     else
-       echo "Can not determine distribution; please specify it manually"
-       echo "with the '-d' option"
+       echo \
+"Can not determine distribution; please specify it manually
+with the '-d' option"  >&2
        exit 1
     fi >&2
 }
@@ -139,8 +140,9 @@ function base.initFilesystem
 {
     test -z "$1" || _renameVserverCfg
     test ! -d "$VDIR" -a ! -d "$SETUP_CONFDIR" || {
-       echo "vserver-topdirectory and/or configuration exist already; "
-       echo "please try to use '--force', or remove them manually"
+       echo \
+"vserver-topdirectory and/or configuration exist already;
+please try to use '--force', or remove them manually" >&2
        exit 1
     } >&2
 
index f57bdd0..7475cc2 100644 (file)
@@ -30,7 +30,7 @@ function pkgmgmt._setPkgCfgBase
     done
 
     test -d "$PKGCFGBASE"  || {
-       echo "pkgcfgbase-dir '$PKGCFGBASE' does not exists or is invalid"
+       echo "pkgcfgbase-dir '$PKGCFGBASE' does not exists or is invalid" >&2
        exit 1
     }
 }
@@ -62,7 +62,7 @@ function pkgmgmt.initFilesystem
     test ! -d "$PKGCFGDIR" || {
        echo $
 "vserver pkgmgmt-directory exists already; please try to use
-'--force'; or remove it manually"
+'--force'; or remove it manually" >&2
        exit 1
     }
 
index 4cc2626..8b87aa1 100644 (file)
@@ -27,7 +27,7 @@ while true; do
        --debug)        set -x;;
        --pkgmgmt)      use_pkgmgmt=1;;
        --)             shift; break ;;
-       *)              echo "vserver-build.skeleton: internal error: unrecognized option '$1'"
+       *)              echo "vserver-build.skeleton: internal error: unrecognized option '$1'" >&2
                        exit 1
                        ;;
     esac
index 8c96ad6..a2c1590 100755 (executable)
@@ -38,7 +38,7 @@
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index d6e6bc6..9db6007 100644 (file)
@@ -327,7 +327,7 @@ function _processSingleInterface
     _getInterfaceValue name   '' "$iface"
     _getInterfaceValue scope  '' "$iface" "$iface/.."
 
-    test "$ip" || { echo $"Can not read ip for '$iface'"; return 1; }
+    test "$ip" || { echo $"Can not read ip for '$iface'"  >&2; return 1; }
     
     test ! -e "$iface"/only_ip   || unset dev
     
@@ -337,7 +337,7 @@ function _processSingleInterface
        case "$dev" in
            *.*)
                test -d /proc/net/vlan || {
-                   echo -e $"VLAN device-name used, but vlan subsystem not enabled.\nTry to execute 'modprobe 8021q' before starting the vservers"
+                   echo -e $"VLAN device-name used, but vlan subsystem not enabled.\nTry to execute 'modprobe 8021q' before starting the vservers"  >&2
                    return 1
                }
                test -f /proc/net/vlan || {
index 77bf92d..d1e4f42 100644 (file)
@@ -16,7 +16,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 if isVserverRunning "$VSERVER_DIR"; then
-    echo $"vserver '$VSERVER_NAME' already running; aborting..."
+    echo $"vserver '$VSERVER_NAME' already running; aborting..." >&2
     exit 1
 fi
 
index 8a5c5a2..f86697a 100644 (file)
@@ -16,7 +16,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 if ! isVserverRunning "$VSERVER_DIR" S_CONTEXT; then
-    echo $"vserver '$VSERVER_NAME' is not running; aborting..."
+    echo $"vserver '$VSERVER_NAME' is not running; aborting..." >&2
     umountVserver     "$VSERVER_DIR" &>/dev/null || :
     disableInterfaces "$VSERVER_DIR" &>/dev/null || :
     exit 1
index b76e33b..b7eac7a 100644 (file)
@@ -20,7 +20,7 @@
 
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index 5d36abd..e74aa8b 100755 (executable)
@@ -20,7 +20,7 @@
 # Helper script for all the v_xxx scripts
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"
index e6e2198..c76d90a 100755 (executable)
@@ -20,7 +20,7 @@
 #Presents the processes running in all virtual servers
 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
 test -e "$UTIL_VSERVER_VARS" || {
-    echo "Can not find util-vserver installation; aborting..."
+    echo "Can not find util-vserver installation; aborting..." >&2
     exit 1
 }
 . "$UTIL_VSERVER_VARS"