X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Ffunctions;h=8c89518c598d168b73542bd8f777954c34336366;hb=97a127fd10421a30f02d64fca74f4df6acf4a0bd;hp=d15cd41f170c52fbbf5e995d731588350580dd89;hpb=39597d225451b1d13a2d1a7b3c83060019e799b0;p=util-vserver.git diff --git a/scripts/functions b/scripts/functions index d15cd41..8c89518 100644 --- a/scripts/functions +++ b/scripts/functions @@ -571,7 +571,7 @@ function _getProcNumberCount # Use /proc/virtual from kernel 2.6 when possible if test -d "/proc/virtual"; then - set -- $($_GREP '^PROC:' "/proc/virtual/$1/limit" 2>/dev/null) + set -- $($_GREP '^Tasks:' "/proc/virtual/$1/status" 2>/dev/null) _gp_procnr_cnt=$2 else _gp_procnr_cnt=$($_VPS ax | $_AWK '{print $2}' | $_GREP -x "$1" | $_WC -l ) @@ -713,8 +713,12 @@ function setDefaultTTY "$__CONFDIR/.defaults/apps/init/tty" \ $2 /dev/null - exec <$ttyname - exec &>$ttyname + if test -f "$ttyname"; then + exec >$ttyname 2>&1 } ## Usage: killContext [] @@ -844,9 +848,11 @@ function vshelper.doSanityCheck vshelper=$(cat "$proc_file") $_CMP -s "$vshelper" "$_VSHELPER" || { + local readable="" + test -r "$vshelper" && readable=1 warnings=( "${warnings[@]}" $"The configured vshelper '$vshelper' does not match the 'vshelper' - script of the util-vserver package" + script of the util-vserver package.${readable:+ Maybe you have two versions installed?}" ) solution_disable=1 solution_sysctl=1