From 66ff8eb2e4f7e51fab7bf0eae4a756c9f54b7132 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Fri, 5 Mar 2004 17:56:40 +0000 Subject: [PATCH] added some '>&2' git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1105 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/scripts/chcontext | 8 ++++---- util-vserver/scripts/functions | 12 ++++++------ util-vserver/scripts/rootshell | 2 +- util-vserver/scripts/vapt-get | 2 +- util-vserver/scripts/vapt-get-worker | 2 +- util-vserver/scripts/vpkg | 2 +- util-vserver/scripts/vpstree | 2 +- util-vserver/scripts/vrpm | 2 +- util-vserver/scripts/vrpm-preload | 2 +- util-vserver/scripts/vrpm-worker | 2 +- util-vserver/scripts/vserver | 10 +++++----- util-vserver/scripts/vserver-build | 6 +++--- util-vserver/scripts/vserver-build.apt-rpm | 2 +- util-vserver/scripts/vserver-build.debootstrap | 2 +- util-vserver/scripts/vserver-build.functions | 12 +++++++----- util-vserver/scripts/vserver-build.functions.pkgmgmt | 4 ++-- util-vserver/scripts/vserver-build.skeleton | 2 +- util-vserver/scripts/vserver-copy | 2 +- util-vserver/scripts/vserver.functions | 4 ++-- util-vserver/scripts/vserver.start | 2 +- util-vserver/scripts/vserver.stop | 2 +- util-vserver/scripts/vservers.grabinfo.sh | 2 +- util-vserver/scripts/vsysvwrapper | 2 +- util-vserver/scripts/vtop | 2 +- 24 files changed, 46 insertions(+), 44 deletions(-) diff --git a/util-vserver/scripts/chcontext b/util-vserver/scripts/chcontext index dded01f..41f1582 100755 --- a/util-vserver/scripts/chcontext +++ b/util-vserver/scripts/chcontext @@ -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 } diff --git a/util-vserver/scripts/functions b/util-vserver/scripts/functions index 21e2991..4ff4e41 100644 --- a/util-vserver/scripts/functions +++ b/util-vserver/scripts/functions @@ -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" diff --git a/util-vserver/scripts/rootshell b/util-vserver/scripts/rootshell index c0cfca7..b365391 100755 --- a/util-vserver/scripts/rootshell +++ b/util-vserver/scripts/rootshell @@ -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" diff --git a/util-vserver/scripts/vapt-get b/util-vserver/scripts/vapt-get index 604ec16..ed1de7f 100755 --- a/util-vserver/scripts/vapt-get +++ b/util-vserver/scripts/vapt-get @@ -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" diff --git a/util-vserver/scripts/vapt-get-worker b/util-vserver/scripts/vapt-get-worker index 2a60ea0..9161dcf 100755 --- a/util-vserver/scripts/vapt-get-worker +++ b/util-vserver/scripts/vapt-get-worker @@ -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" diff --git a/util-vserver/scripts/vpkg b/util-vserver/scripts/vpkg index 0a54bf4..153fe55 100755 --- a/util-vserver/scripts/vpkg +++ b/util-vserver/scripts/vpkg @@ -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" diff --git a/util-vserver/scripts/vpstree b/util-vserver/scripts/vpstree index 506e518..9a4f0c6 100755 --- a/util-vserver/scripts/vpstree +++ b/util-vserver/scripts/vpstree @@ -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" diff --git a/util-vserver/scripts/vrpm b/util-vserver/scripts/vrpm index 92aa7b9..86d6d1c 100755 --- a/util-vserver/scripts/vrpm +++ b/util-vserver/scripts/vrpm @@ -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" diff --git a/util-vserver/scripts/vrpm-preload b/util-vserver/scripts/vrpm-preload index 55cce0e..1036e5c 100755 --- a/util-vserver/scripts/vrpm-preload +++ b/util-vserver/scripts/vrpm-preload @@ -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" diff --git a/util-vserver/scripts/vrpm-worker b/util-vserver/scripts/vrpm-worker index a32e47b..b5694b6 100755 --- a/util-vserver/scripts/vrpm-worker +++ b/util-vserver/scripts/vrpm-worker @@ -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" diff --git a/util-vserver/scripts/vserver b/util-vserver/scripts/vserver index 27bc37d..817d835 100755 --- a/util-vserver/scripts/vserver +++ b/util-vserver/scripts/vserver @@ -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 diff --git a/util-vserver/scripts/vserver-build b/util-vserver/scripts/vserver-build index 463294f..c2e30e3 100755 --- a/util-vserver/scripts/vserver-build +++ b/util-vserver/scripts/vserver-build @@ -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" diff --git a/util-vserver/scripts/vserver-build.apt-rpm b/util-vserver/scripts/vserver-build.apt-rpm index ec6c3c5..230c801 100644 --- a/util-vserver/scripts/vserver-build.apt-rpm +++ b/util-vserver/scripts/vserver-build.apt-rpm @@ -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 diff --git a/util-vserver/scripts/vserver-build.debootstrap b/util-vserver/scripts/vserver-build.debootstrap index df2eb9a..52dcd7a 100644 --- a/util-vserver/scripts/vserver-build.debootstrap +++ b/util-vserver/scripts/vserver-build.debootstrap @@ -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 diff --git a/util-vserver/scripts/vserver-build.functions b/util-vserver/scripts/vserver-build.functions index 6f0503e..b12a5d5 100644 --- a/util-vserver/scripts/vserver-build.functions +++ b/util-vserver/scripts/vserver-build.functions @@ -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 diff --git a/util-vserver/scripts/vserver-build.functions.pkgmgmt b/util-vserver/scripts/vserver-build.functions.pkgmgmt index f57bdd0..7475cc2 100644 --- a/util-vserver/scripts/vserver-build.functions.pkgmgmt +++ b/util-vserver/scripts/vserver-build.functions.pkgmgmt @@ -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 } diff --git a/util-vserver/scripts/vserver-build.skeleton b/util-vserver/scripts/vserver-build.skeleton index 4cc2626..8b87aa1 100644 --- a/util-vserver/scripts/vserver-build.skeleton +++ b/util-vserver/scripts/vserver-build.skeleton @@ -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 diff --git a/util-vserver/scripts/vserver-copy b/util-vserver/scripts/vserver-copy index 8c96ad6..a2c1590 100755 --- a/util-vserver/scripts/vserver-copy +++ b/util-vserver/scripts/vserver-copy @@ -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" diff --git a/util-vserver/scripts/vserver.functions b/util-vserver/scripts/vserver.functions index d6e6bc6..9db6007 100644 --- a/util-vserver/scripts/vserver.functions +++ b/util-vserver/scripts/vserver.functions @@ -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 || { diff --git a/util-vserver/scripts/vserver.start b/util-vserver/scripts/vserver.start index 77bf92d..d1e4f42 100644 --- a/util-vserver/scripts/vserver.start +++ b/util-vserver/scripts/vserver.start @@ -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 diff --git a/util-vserver/scripts/vserver.stop b/util-vserver/scripts/vserver.stop index 8a5c5a2..f86697a 100644 --- a/util-vserver/scripts/vserver.stop +++ b/util-vserver/scripts/vserver.stop @@ -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 diff --git a/util-vserver/scripts/vservers.grabinfo.sh b/util-vserver/scripts/vservers.grabinfo.sh index b76e33b..b7eac7a 100644 --- a/util-vserver/scripts/vservers.grabinfo.sh +++ b/util-vserver/scripts/vservers.grabinfo.sh @@ -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" diff --git a/util-vserver/scripts/vsysvwrapper b/util-vserver/scripts/vsysvwrapper index 5d36abd..e74aa8b 100755 --- a/util-vserver/scripts/vsysvwrapper +++ b/util-vserver/scripts/vsysvwrapper @@ -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" diff --git a/util-vserver/scripts/vtop b/util-vserver/scripts/vtop index e6e2198..c76d90a 100755 --- a/util-vserver/scripts/vtop +++ b/util-vserver/scripts/vtop @@ -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" -- 1.8.1.5