[PVE-User] vzifup-post errors
Derek W. Poon
derekp+pve at ece.ubc.ca
Wed Apr 21 01:30:42 CEST 2010
When I run /sbin/ifup vmbr1, the following error appears:
Usage: vzarp-ifup DEVICE
run-parts: /etc/network/if-up.d/vzifup-post exited with return code 1
# dpkg -l vzctl
||/ Name Version Description
+++-==============-==============-=======================================
ii vzctl 3.0.23-1pve8 OpenVZ - server virtualization solution
According to interfaces(5), the interface name is passed to post-up scripts via the $IFACE environment variable, not via a command-line argument. The following patch fixes that, as well as a syntax error with a -z test.
--- usr/sbin/vzifup-post 2010-01-28 02:36:17.000000000 -0800
+++ /usr/sbin/vzifup-post 2010-04-20 13:04:15.000000000 -0700
@@ -21,5 +21,5 @@
usage()
{
- echo "Usage: vzarp-ifup DEVICE" 1>&2
+ echo "Usage: IFACE=... vzarp-ifup" 1>&2
exit 1
}
@@ -28,16 +28,15 @@
# Supplied interface name
-DEV=$1
-[ -z "${DEV}" ] && usage
+[ -z "${IFACE}" ] && usage
# Get possible interface names
vzgetnetdev
-[-z "${NETDEVICES}" ] && exit 0
+[ -z "${NETDEVICES}" ] && exit 0
# Check if a device name given is in the list returned by vzgetnetdev
# Indeed we do not want to add arp entries for e.g. 'lo'
-echo "${NETDEVICES}" | grep -qw "${DEV}" || exit 0
+echo "${NETDEVICES}" | grep -qw "${IFACE}" || exit 0
-NETDEVICES="${DEV}"
+NETDEVICES="${IFACE}"
update_arp
exit 0
More information about the pve-user
mailing list