From: Enrico Scholz Date: Fri, 28 Oct 2005 18:40:39 +0000 (+0000) Subject: when building new vservers allow empty directories for their roots X-Git-Tag: version_0_30_210~82 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c5d64c3930b12e8a0af8aa3f8c88b3b43156ddc;p=util-vserver.git when building new vservers allow empty directories for their roots improved error messages a little bit git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2199 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/scripts/vserver-build.functions b/util-vserver/scripts/vserver-build.functions index 18c3c85..4d78cdd 100644 --- a/util-vserver/scripts/vserver-build.functions +++ b/util-vserver/scripts/vserver-build.functions @@ -105,7 +105,7 @@ function _renameVserverCfg local i for i in "$VDIR" "$SETUP_CONFDIR"; do - test ! -e "$i" || { + test ! -e "$i" || isDirectoryEmpty "$i" || { mv "$i" "$i$suffix" say "Renamed '$i' to '$i$suffix'" } @@ -164,13 +164,9 @@ function base._addGeneratedFile function base.initFilesystem { test -z "$1" || _renameVserverCfg - test isDirectoryEmpty "$VDIR" -a ! -e "$SETUP_CONFDIR" || { - echo \ -"vserver-topdirectory '$VDIR' and/or configuration at '$SETUP_CONFDIR' -exist already; please try to use '--force', or remove them manually" ->&2 - exit 1 - } >&2 + { isDirectoryEmpty "$VDIR" && test ! -e "$SETUP_CONFDIR"; } || colpanic $"\ +vserver-topdirectory '$VDIR' and/or configuration at '$SETUP_CONFDIR' +exist already; please try to use '--force', or remove them manually." mkdir -p -m755 "$VDIR" chattr -t "$VDIR"