diff --git a/bin/vzifup-post.in b/bin/vzifup-post.in index 37cc7bb..84eec53 100755 --- a/bin/vzifup-post.in +++ b/bin/vzifup-post.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Copyright (C) 2008-2011, Parallels, Inc. All rights reserved. # # Update ARP table for all containers on interface up diff --git a/bin/vzmigrate.in b/bin/vzmigrate.in index 51e3d38..7764e06 100755 --- a/bin/vzmigrate.in +++ b/bin/vzmigrate.in @@ -412,7 +412,7 @@ ploop_copy() { # check if ssh is still there kill -0 $pid 2>/dev/null && break - let try=try+1 + try="$((try+1))" done if [ $try = 5 ]; then @@ -839,7 +839,7 @@ logexec 2 $SSH root@$host $VZCTL set $VEID --private $VE_PRIVATE_REMOTE --root $ logexec 2 $SSH root@$host $VZCTL set $VEID --applyconfig_map name --save RET=$? # vzctl return code 20 or 21 in case of unrecognized option -if [ $RET != 20 ] && [ $RET != 21 ] && [ $RET != 0 ]; then +if [ $RET != 20 -a $RET != 21 -a $RET != 0 ]; then log 0 "Failed to apply config on destination node" undo_conf exit $MIG_ERR_APPLY_CONFIG diff --git a/configure.ac b/configure.ac index 4d7f9fb..ea98c53 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Disable build of static libraries by default. AC_DISABLE_STATIC +# Arrange for 64-bit file offsets. +AC_SYS_LARGEFILE + # If AC_USE_SYSTEM_EXTENSIONS is available (autoconf >= 2.60), # use it. Otherwise, use old AC_GNU_SOURCE m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], @@ -78,7 +81,6 @@ AC_PROG_MAKE_SET CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-qual -Winline -Wextra" CFLAGS="${CFLAGS} -Wcast-align -Wno-unused-parameter" CFLAGS="${CFLAGS} -Wno-missing-field-initializers" -CFLAGS="${CFLAGS} -D_FILE_OFFSET_BITS=64" # We need -m64 for ppc64 in order to get proper ioctls if test x$target_cpu = xppc64 -o x$target_cpu = xpowerpc64; then diff --git a/etc/dists/scripts/arch-add_ip.sh b/etc/dists/scripts/arch-add_ip.sh index f94f9c8..1074f0e 100755 --- a/etc/dists/scripts/arch-add_ip.sh +++ b/etc/dists/scripts/arch-add_ip.sh @@ -84,7 +84,7 @@ old_get_free_aliasid() [ -z "${IFNUMLIST}" ] && old_get_all_aliasid while test -z ${found}; do - let IFNUM=IFNUM+1 + IFNUM="$((IFNUM+1))" echo "${IFNUMLIST}" | grep -q -E "^${IFNUM}$" 2>/dev/null || found=1 done @@ -219,7 +219,7 @@ get_free_aliasid() [ -z "${IFNUMLIST}" ] && get_all_aliasid while test -z ${found}; do - let IFNUM=IFNUM+1 + IFNUM="$((IFNUM+1))" echo "${IFNUMLIST}" | grep -q -E "^${IFNUM}$" 2>/dev/null || found=1 done diff --git a/etc/dists/scripts/arch-del_ip.sh b/etc/dists/scripts/arch-del_ip.sh index 60b26ee..72cf44e 100755 --- a/etc/dists/scripts/arch-del_ip.sh +++ b/etc/dists/scripts/arch-del_ip.sh @@ -57,7 +57,7 @@ old_del_ip() grep "^${VENET_DEV}_" | cut -d'=' -f1) if [ -n "${ifname}" ]; then # shutdown interface venet0:x - /etc/rc.d/network ifdown ${ifname/_/:} 2> /dev/null + /etc/rc.d/network ifdown "$(echo "$ifname" | sed -e 's,_,:,')" 2> /dev/null # remove venet0_x from cfg del_param "${OLDCFGFILE}" "${ifname}" @@ -113,7 +113,7 @@ del_ip() netcfg "${VENET_DEV}" } -function netctl_del_ip() +netctl_del_ip() { local ipm diff --git a/etc/dists/scripts/debian-add_ip.sh b/etc/dists/scripts/debian-add_ip.sh index 36b9f50..fcc9c40 100755 --- a/etc/dists/scripts/debian-add_ip.sh +++ b/etc/dists/scripts/debian-add_ip.sh @@ -131,7 +131,6 @@ iface ${VENET_DEV}:${ifnum} inet static sed -i -e "s/iface ${VENET_DEV} inet6 manual/iface ${VENET_DEV} inet6 manual\n\tup ifconfig ${VENET_DEV} add ${ip}\/${mask}\n\tdown ifconfig ${VENET_DEV} del ${ip}\/${mask}/" ${CFGFILE}.bak need_restart=yes fi - } get_all_aliasid() diff --git a/etc/dists/scripts/functions b/etc/dists/scripts/functions index 0d5b23f..598acbe 100755 --- a/etc/dists/scripts/functions +++ b/etc/dists/scripts/functions @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # @@ -256,9 +256,8 @@ change_hostname() local comm='# Auto-generated hostname. Please do not remove this comment.' [ -f "$cfg" ] || touch "$cfg" - if [ "$host" = "localhost" -o "$host" = "localhost.localdomain" ]; - then - put_param2 "$cfg" "127.0.0.1" "localhost.localdomain localhost" + if [ "$host" = 'localhost' -o "$host" = 'localhost.localdomain' ]; then + put_param2 "$cfg" '127.0.0.1' 'localhost.localdomain localhost' return 0 fi ${CP} "$cfg" "$cfg.$$" || diff --git a/etc/dists/scripts/funtoo-add_ip.sh b/etc/dists/scripts/funtoo-add_ip.sh index 1eb801d..82cfd63 100755 --- a/etc/dists/scripts/funtoo-add_ip.sh +++ b/etc/dists/scripts/funtoo-add_ip.sh @@ -45,13 +45,13 @@ set_rc() { [ -f "${SCRIPT}" ] && return 0 ln -sf netif.tmpl /etc/init.d/netif.${VENET_DEV} - rc-update add netif.${VENET_DEV} default &>/dev/null + rc-update add netif.${VENET_DEV} default >/dev/null 2>&1 } unset_rc() { # used for disabling venet if we are using veth and no IPs are specified - rc-update del netif.${VENET_DEV} default &>/dev/null + rc-update del netif.${VENET_DEV} default >/dev/null 2>&1 rm -f /etc/init.d/netif.${VENET_DEV} rm -f /etc/conf.d/netif.${VENET_DEV} ip link set ${VENET_DEV} down > /dev/null 2>&1 diff --git a/etc/dists/scripts/funtoo-del_ip.sh b/etc/dists/scripts/funtoo-del_ip.sh index 0988cd8..078896a 100755 --- a/etc/dists/scripts/funtoo-del_ip.sh +++ b/etc/dists/scripts/funtoo-del_ip.sh @@ -25,7 +25,7 @@ CFGFILE=/etc/conf.d/netif.${VENET_DEV} unset_rc() { # used for disabling venet if we are using veth and no IPs are specified - rc-update del netif.${VENET_DEV} default &>/dev/null + rc-update del netif.${VENET_DEV} default >/dev/null 2>&1 rm -f /etc/init.d/netif.${VENET_DEV} rm -f /etc/conf.d/netif.${VENET_DEV} ip link set ${VENET_DEV} down > /dev/null 2>&1 diff --git a/etc/dists/scripts/funtoo-set_hostname.sh b/etc/dists/scripts/funtoo-set_hostname.sh index 43eaee0..fff4326 100755 --- a/etc/dists/scripts/funtoo-set_hostname.sh +++ b/etc/dists/scripts/funtoo-set_hostname.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Copyright (C) 2000-2009, Parallels, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify @@ -18,7 +18,7 @@ # # This script sets hostname inside Funtoo based CT. -function set_hostname() +set_hostname() { local cfgfile=$1 local hostname=$2 diff --git a/etc/dists/scripts/gentoo-add_ip.sh b/etc/dists/scripts/gentoo-add_ip.sh index a8c395a..31201a0 100755 --- a/etc/dists/scripts/gentoo-add_ip.sh +++ b/etc/dists/scripts/gentoo-add_ip.sh @@ -62,10 +62,10 @@ set_config() set_rc() { [ -f "${SCRIPT}" ] && return 0 - rc-update del net.eth0 &>/dev/null - rc-update add net.lo boot &>/dev/null + rc-update del net.eth0 >/dev/null 2>&1 + rc-update add net.lo boot >/dev/null 2>&1 ln -sf /etc/init.d/net.lo /etc/init.d/net.${VENET_DEV} - rc-update add net.${VENET_DEV} default &>/dev/null + rc-update add net.${VENET_DEV} default >/dev/null 2>&1 } init_netconfig() diff --git a/etc/dists/scripts/gentoo-del_ip.sh b/etc/dists/scripts/gentoo-del_ip.sh index 7c98f2a..e8a2ae3 100755 --- a/etc/dists/scripts/gentoo-del_ip.sh +++ b/etc/dists/scripts/gentoo-del_ip.sh @@ -35,7 +35,7 @@ del_ip() if [ "x${IPDELALL}" = "xyes" ]; then /etc/init.d/net.${VENET_DEV} stop >/dev/null 2>&1 - rc-update del net.${VENET_DEV} default &>/dev/null + rc-update del net.${VENET_DEV} default >/dev/null 2>&1 rm -f /etc/init.d/net.${VENET_DEV} sed -i -e '/_${VENET_DEV}/d' $CFGFILE return 0 diff --git a/etc/dists/scripts/postcreate.sh b/etc/dists/scripts/postcreate.sh index 753effa..ec4e0ac 100755 --- a/etc/dists/scripts/postcreate.sh +++ b/etc/dists/scripts/postcreate.sh @@ -40,8 +40,8 @@ randcrontab() [ -f "${file}" ] || continue grep -wq VZCTL_POSTCREATE_SKIP "${file}" && continue - /bin/cp -fp ${file} ${file}.$$ - cat ${file} | awk ' + cp -fp ${file} ${file}.$$ + awk ' BEGIN { srand(); } { if ($0 ~ /^[ \t]*#/ || $0 ~ /^[ \t]+*$/) { @@ -72,21 +72,50 @@ BEGIN { srand(); } line = line " " ar[i]; } print line; -}' > ${file}.$$ && /bin/mv -f ${file}.$$ ${file} - /bin/rm -f ${file}.$$ 2>/dev/null +}' <"$file" > ${file}.$$ && mv -f ${file}.$$ ${file} + rm -f ${file}.$$ 2>/dev/null done } disableroot() { - local file=${VE_ROOT}"/etc/passwd" + local file="${VE_ROOT}/etc/passwd" - [ -f "$file" ] || return 0 + [ -f "$file" ] && + grep -qs '^root::' "$file" || + return 0 - if /bin/grep -q "^root::" "${file}" 2>/dev/null; then - /bin/sed 's/^root::/root:!!:/g' < ${file} > ${file}.$$ && - /bin/mv -f ${file}.$$ ${file} - /bin/rm -f ${file}.$$ 2>/dev/null + sed -i 's/^root::/root:!!:/g' "$file" +} + +fixinittab() +{ + file="$VE_ROOT/etc/inittab" + + [ -f "$file" ] && + grep -qs '^[0-9].*mingetty.*tty' "$file" || + return 0 + + sed -i 's|^[0-9].*mingetty.*tty|#&|' "$file" +} + +fixsyslog() +{ + file="$VE_ROOT/etc/syslog.conf" + + [ -f "$file" ] && + grep -qs '^[^#[:space:]]\+[[:space:]]\+/dev/tty' "$file" || + return 0 + + sed -i 's|^[^#[:space:]]\+[[:space:]]\+/dev/tty|#&|' "$file" +} + +copy_localtime() +{ + local f=/etc/localtime + if [ -s "$f" ]; then + rm -f -- "$VE_ROOT$f" && + install -pm644 -- "$f" "$VE_ROOT$f" fi } @@ -150,11 +179,18 @@ set_file_caps() fi } -[ -z "${VE_ROOT}" ] && exit 1 +[ -n "$VE_ROOT" ] || exit 1 umask 0022 randcrontab disableroot set_network set_file_caps +fixinittab +fixsyslog +copy_localtime +if [ -d /etc/hooks/post_create.d ] && + type run-parts >/dev/null 2>&1; then + run-parts /etc/hooks/post_create.d +fi exit 0 diff --git a/etc/dists/scripts/redhat-7.x_add_ip.sh b/etc/dists/scripts/redhat-7.x_add_ip.sh index 4e9e307..3c0f4d0 100755 --- a/etc/dists/scripts/redhat-7.x_add_ip.sh +++ b/etc/dists/scripts/redhat-7.x_add_ip.sh @@ -104,7 +104,7 @@ get_free_aliasid() [ -z "${IFNUMLIST}" ] && get_all_aliasid while test -z ${found}; do - let IFNUM=IFNUM+1 + IFNUM=$((IFNUM+1)) echo "${IFNUMLIST}" | grep -q -E "^${IFNUM}$" 2>/dev/null || found=1 done diff --git a/etc/dists/scripts/redhat-add_ip.sh b/etc/dists/scripts/redhat-add_ip.sh index ffabb9f..c911407 100755 --- a/etc/dists/scripts/redhat-add_ip.sh +++ b/etc/dists/scripts/redhat-add_ip.sh @@ -31,14 +31,10 @@ fix_ifup() file="/sbin/ifup" [ -f "${file}" ] || return 0 - [ "x${VE_STATE}" != "xstarting" ] && return 0 - - if grep -q 'if \[ "\${DEVICE}" = "lo" \]; then' ${file} 2>/dev/null - then - ${CP} ${file} ${file}.$$ || return 1 - /bin/sed -e 's/if \[ "\${DEVICE}" = "lo" \]; then/if \[ "${IPADDR}" = "127.0.0.1" \]; then/g' < ${file} > ${file}.$$ && - mv -f ${file}.$$ ${file} - rm -f ${file}.$$ 2>/dev/null + [ "${VE_STATE}" = "starting" ] || return 0 + + if grep -qs 'if \[ "\${DEVICE}" = "lo" \]; then' "${file}"; then + sed -i 's/if \[ "\${DEVICE}" = "lo" \]; then/if \[ "${IPADDR}" = "127.0.0.1" \]; then/g' "${file}" fi } @@ -53,34 +49,34 @@ ARPCHECK=\"no\" IPADDR=127.0.0.1 NETMASK=255.255.255.255 BROADCAST=0.0.0.0 -ARPCHECK=\"no\"" > $IFCFG || error "Can't write to file $IFCFG" $VZ_FS_NO_DISK_SPACE +ARPCHECK=\"no\"" > "${IFCFG}" || error "Can't write to file ${IFCFG}" ${VZ_FS_NO_DISK_SPACE} # Set /etc/sysconfig/network - put_param $NETFILE NETWORKING yes + put_param "${NETFILE}" NETWORKING yes # Set default route to venet0 - put_param $NETFILE GATEWAYDEV ${VENET_DEV} + put_param "${NETFILE}" GATEWAYDEV ${VENET_DEV} # Remove old (obsoleted) fake route - del_param $NETFILE GATEWAY + del_param "${NETFILE}" GATEWAY # setup ipv6 setup6_network # Set up /etc/hosts - if [ ! -f ${HOSTFILE} ]; then - echo "127.0.0.1 localhost.localdomain localhost" > $HOSTFILE + if [ ! -f "${HOSTFILE}" ]; then + echo "127.0.0.1 localhost.localdomain localhost" > "${HOSTFILE}" fi fix_ifup } setup6_network() { - [ "${IPV6}" != "yes" ] && return 0 + [ "${IPV6}" = "yes" ] || return 0 - if ! grep -q 'IPV6INIT="yes"' ${IFCFG}; then - put_param ${IFCFG} IPV6INIT yes + if ! grep -q 'IPV6INIT="yes"' "${IFCFG}"; then + put_param "${IFCFG}" IPV6INIT yes fi - if ! grep -q 'NETWORKING_IPV6="yes"' ${NETFILE}; then - put_param ${NETFILE} NETWORKING_IPV6 yes - put_param ${NETFILE} IPV6_DEFAULTDEV ${VENET_DEV} + if ! grep -q 'NETWORKING_IPV6="yes"' "${NETFILE}"; then + put_param "${NETFILE}" NETWORKING_IPV6 yes + put_param "${NETFILE}" IPV6_DEFAULTDEV "${VENET_DEV}" NETWORKRESTART=yes fi } @@ -102,8 +98,8 @@ NETMASK=${netmask}" > $file || add_ip6() { - [ "${IPV6}" != "yes" ] && return 0 - if ! grep -qw "$1" ${IFCFG} 2>/dev/null; then + [ "$IPV6" = "yes" ] || return 0 + if ! grep -qsw "$1" "${IFCFG}"; then setup6_network add_param ${IFCFG} IPV6ADDR_SECONDARIES "$1/$2" if have_ifconfig; then @@ -139,7 +135,7 @@ get_free_aliasid() [ -z "${IFNUMLIST}" ] && get_all_aliasid while test -z ${found}; do - let IFNUM=IFNUM+1 + IFNUM=$((IFNUM+1)) echo "${IFNUMLIST}" | grep -q -E "^${IFNUM}$" 2>/dev/null || found=1 done diff --git a/etc/dists/scripts/set_console.sh b/etc/dists/scripts/set_console.sh index cddc8c8..e9faa39 100755 --- a/etc/dists/scripts/set_console.sh +++ b/etc/dists/scripts/set_console.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Copyright (C) 2012-2014, Parallels, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify diff --git a/etc/dists/scripts/set_dns.sh b/etc/dists/scripts/set_dns.sh index 1ad0f8a..b91b713 100755 --- a/etc/dists/scripts/set_dns.sh +++ b/etc/dists/scripts/set_dns.sh @@ -30,14 +30,13 @@ set_dns() fi if [ -n "${server}" ]; then [ -f ${cfgfile} ] || touch ${cfgfile} - sed '/^\s*nameserver\s/d' ${cfgfile} > ${cfgfile}.$$ && - mv -f ${cfgfile}.$$ ${cfgfile} || + sed -i '/^\s*nameserver\s/d' ${cfgfile} || error "Can't change file ${cfgfile}" ${VZ_FS_NO_DISK_SPACE} for srv in ${server}; do - echo "nameserver ${srv}" >> ${cfgfile} + echo "nameserver ${srv}" >> "${cfgfile}" done fi - chmod 644 ${cfgfile} + chmod 644 "${cfgfile}" } gen_resolvconf() { @@ -54,4 +53,9 @@ else set_dns /etc/resolv.conf "${NAMESERVER}" "${SEARCHDOMAIN}" fi +if [ -d /etc/hooks/set_dns.d ] && + type run-parts >/dev/null 2>&1; then + run-parts /etc/hooks/set_dns.d "$NAMESERVER" "$SEARCHDOMAIN" +fi + exit 0 diff --git a/etc/dists/scripts/set_userpass.sh b/etc/dists/scripts/set_userpass.sh index 8f7b65c..67f08a6 100755 --- a/etc/dists/scripts/set_userpass.sh +++ b/etc/dists/scripts/set_userpass.sh @@ -26,13 +26,13 @@ set_serrpasswd() local user=$(echo $userpw | sed 's/:.*$//') local passwd=$(echo $userpw | sed 's/^[^:]*://') - if [ -z "${user}" -o -z "${passwd}" ]; then + if [ -z "${user}" -o -z "${passwd}" ]; then exit $VZ_CHANGEPASS fi if [ ! -c /dev/urandom ]; then mknod /dev/urandom c 1 9 > /dev/null fi - if ! grep -E "^${user}:" ${CFGFILE} 2>&1 >/dev/null; then + if ! grep -qs "^${user}:" ${CFGFILE}; then useradd -m "${user}" 2>&1 || exit $VZ_CHANGEPASS fi echo "${passwd}" | passwd --stdin "${user}" 2>/dev/null @@ -41,7 +41,11 @@ set_serrpasswd() fi } -[ -z "${USERPW}" ] && return 0 +[ -n "${USERPW}" ] || return 0 set_serrpasswd "${USERPW}" +if [ -d /etc/hooks/set_userpass.d ] && + type run-parts >/dev/null 2>&1; then + run-parts /etc/hooks/set_userpass.d "$USERPW" +fi exit 0 diff --git a/etc/dists/scripts/slackware-9.x_del_ip.sh b/etc/dists/scripts/slackware-9.x_del_ip.sh index cd6c96c..fd9e2aa 100755 --- a/etc/dists/scripts/slackware-9.x_del_ip.sh +++ b/etc/dists/scripts/slackware-9.x_del_ip.sh @@ -27,7 +27,7 @@ del_ip() [ -f ${IFCFG} ] || return 0 if [ "x${IPDELALL}" = "xyes" ]; then - /sbin/ifconfig venet0 down + ifconfig venet0 down mv -f ${IFCFG} ${IFCFG}.bak return 0 fi @@ -35,7 +35,7 @@ del_ip() for ipm in ${IP_ADDR}; do ip_conv $ipm if grep -wq "${_IP}" ${IFCFG} 2>/dev/null; then - /sbin/ifconfig venet0 down + ifconfig venet0 down put_param ${IFCFG} "IPADDR" "" break fi diff --git a/etc/dists/scripts/suse-7.x_add_ip.sh b/etc/dists/scripts/suse-7.x_add_ip.sh index 9a56934..912ae39 100755 --- a/etc/dists/scripts/suse-7.x_add_ip.sh +++ b/etc/dists/scripts/suse-7.x_add_ip.sh @@ -73,7 +73,7 @@ add_ip() for ipm in ${IP_ADDR}; do ip_conv $ipm aliasid=${IP_NUM} - let IP_NUM=IP_NUM+1 + IP_NUM=$((IP_NUM+1)) # build 'IPADDR_x' records put_param ${CFGFILE} IPADDR_${IP_NUM} "${_IP}" # build 'NETDEV_x' records diff --git a/etc/dists/scripts/suse-8.x_add_ip.sh b/etc/dists/scripts/suse-8.x_add_ip.sh index 9c072a4..dfc31ea 100755 --- a/etc/dists/scripts/suse-8.x_add_ip.sh +++ b/etc/dists/scripts/suse-8.x_add_ip.sh @@ -77,7 +77,7 @@ get_free_aliasid() [ -z "${IFNUMLIST}" ] && get_all_aliasid while test -z ${found}; do - let IFNUM=IFNUM+1 + IFNUM=$((IFNUM+1)) echo "${IFNUMLIST}" | grep -q -E "^${IFNUM}$" 2>/dev/null || found=1 done diff --git a/etc/dists/scripts/suse-add_ip.sh b/etc/dists/scripts/suse-add_ip.sh index 05bfb79..0380f6a 100755 --- a/etc/dists/scripts/suse-add_ip.sh +++ b/etc/dists/scripts/suse-add_ip.sh @@ -100,7 +100,7 @@ IPADDR=127.0.0.1" > ${IFCFG} || error "Can't write to file ${IFCFG}" ${VZ_FS_NO_DISK_SPACE} # Set up /etc/hosts - [ -f $"{HOSTFILE}" ] || echo "127.0.0.1 localhost.localdomain localhost" > $HOSTFILE + [ -f "${HOSTFILE}" ] || echo "127.0.0.1 localhost.localdomain localhost" > $HOSTFILE # Set default route to venet0 only if there are IPs # and there is no other default route rm -f ${ROUTES} @@ -151,7 +151,7 @@ add_ip() continue fi while test -z ${found}; do - let ifnum++ + ifnum=$((ifnum+1)) if ! echo "${IFNUMLIST}" | grep -w -q "${ifnum}"; then found=1 fi diff --git a/man/vzctl.8.in b/man/vzctl.8.in index 95e0da2..4e275bf 100644 --- a/man/vzctl.8.in +++ b/man/vzctl.8.in @@ -1458,11 +1458,11 @@ Error compacting ploop image .IP 167 Error listing ploop snapsots .SH EXAMPLES -To create and start "basic" container with ID of 1000 using -\fBcentos-5\fR OS template and IP address of 192.168.10.200: +To create and start "basic" container with ID of 1000 using \fBaltlinux\fR +OS template and IP address of 192.168.10.200: .PP .EX - vzctl create 1000 --ostemplate centos-5 --config basic + vzctl create 1000 --ostemplate altlinux --config basic vzctl set 1000 --ipadd 192.168.10.200 --save vzctl start 1000 .EE diff --git a/scripts/vz-postinstall.in b/scripts/vz-postinstall.in index b9c892a..ce9f347 100755 --- a/scripts/vz-postinstall.in +++ b/scripts/vz-postinstall.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # OpenVZ post-install script # Copyright (C) 2009-2013, Parallels, Inc. Licensed under GNU GPL. # @@ -20,7 +20,7 @@ check_file() local file for file in $*; do - test -a $file || fatal "$file not found" + test -f $file || fatal "$file not found" test -w $file || fatal "$file is not writable" done } @@ -34,7 +34,7 @@ change_param() { local file=$1 p=$2 v=$3 # Escape dots, to be used for regexps - local pp=${p//./\\.} + local pp="$(echo $p | sed -e 's,\.,\\.,g')" # Check if param is there if grep -q "^[ \t]*${p}[ \t]*=.*" $file; then @@ -79,7 +79,7 @@ disable_selinux() test -d $(dirname $file) || return # If there's no $file, create it - test -a $file || touch $file + test -e $file || touch $file # Check we can write to it check_file $file @@ -94,7 +94,7 @@ disable_kernel() local file=/etc/yum.conf # if there is no file, nothing to do - test -a $file || return 0 + test -e $file || return 0 # Check we can write to it check_file $file diff --git a/scripts/vzevent-stop.in b/scripts/vzevent-stop.in index 95055f7..c745748 100755 --- a/scripts/vzevent-stop.in +++ b/scripts/vzevent-stop.in @@ -60,7 +60,7 @@ fi . @PKGCONFDIR@/vz.conf . @VPSCONFDIR@/$VEID.conf test -f $VE_ROOT/reboot || exit 0 - $(awk '$2 == "'$VE_ROOT'" && $4 !~ "^rw" { + $(awk '$2 == "'$VE_ROOT'" && $4 !~ "^rw" { \ print "mount -oremount,rw",$1,$2}' /proc/mounts) rm -f $VE_ROOT/reboot exit 111