--- Begin Message ---
Package: vzctl
Version: 3.0.24-12
As per http://wiki.openvz.org/Disable_venet_interface I'm attempting to
rid the system of venet.
As mentioned in the above page, just commenting out the VEDEV= line is
not enough, the init script also has to be editted.
I have attached a patch for the init script that does two things:
1. It adds a check for the VEDEV variable in both the start_net and
stop_net functions
2. It splits out the variables defined in the init script to /etc/default/vz
The contents of /etc/default/vz are as follows:
VZQUOTA=/usr/sbin/vzquota
CONFIG_DIR=/etc/vz/conf
LOCKFILE=$VARLOCK/vz_lock
SUBSYS_VZ=$VARLOCK/vz
VESTAT=/proc/vz/vestat
# VZDEV=venet0
PRELOAD_MODULES=
MODULES=
MODULES_OTHER=
NET_MODULES=
IPT_MODULES=
The reason for splitting out the definition of the variables is so that
the next time vzctl is updated, VENET won't suddenly get re-enabled!
--
The virus contained in this message was not detected.
http://niall.donegan.tel
--- vz.orig 2011-04-27 13:37:05.000000000 +0100
+++ vz 2011-04-27 13:41:44.000000000 +0100
@@ -40,17 +40,9 @@
. /usr/lib/vzctl/scripts/initd-functions
-VZQUOTA=/usr/sbin/vzquota
-CONFIG_DIR=/etc/vz/conf
-LOCKFILE=$VARLOCK/vz_lock
-SUBSYS_VZ=$VARLOCK/vz
-VESTAT=/proc/vz/vestat
-VZDEV=venet0
-PRELOAD_MODULES=
-MODULES=
-MODULES_OTHER=
-NET_MODULES=
-IPT_MODULES=
+if [ -f /etc/default/vz ] ; then
+ . /etc/default/vz
+fi
if [ "${MODULES_DISABLED}" != "yes" ]; then
PRELOAD_MODULES="af_packet"
@@ -182,14 +174,16 @@
if [ -z "$VEINFO" ]; then
return 0
fi
- __echo "Bringing up interface $VZDEV: "
- ip link set $VZDEV up
- print_result
- ip addr add 0.0.0.0/0 dev $VZDEV
- if [ "${IPV6}" = "yes" ]; then
- ip -6 addr add fe80::1/128 dev $VZDEV
+ if [ -n "$VZDEV" ]; then
+ __echo "Bringing up interface $VZDEV: "
+ ip link set $VZDEV up
+ print_result
+ ip addr add 0.0.0.0/0 dev $VZDEV
+ if [ "${IPV6}" = "yes" ]; then
+ ip -6 addr add fe80::1/128 dev $VZDEV
+ fi
+ sysctl -q -w net.ipv4.conf.$VZDEV.send_redirects=0
fi
- sysctl -q -w net.ipv4.conf.$VZDEV.send_redirects=0
if [ "$(sysctl -n -e net.ipv4.ip_forward)" != "1" ]; then
print_warning "IP forwarding is not enabled"
fi
@@ -198,11 +192,13 @@
stop_net()
{
local mod
-
- if ip addr list | grep -q "venet0:.*UP" 2>/dev/null; then
- __echo "Bringing down interface $VZDEV: "
- ip link set $VZDEV down
- print_result
+
+ if [ -n "$VZDEV" ]; then
+ if ip addr list | grep -q "venet0:.*UP" 2>/dev/null; then
+ __echo "Bringing down interface $VZDEV: "
+ ip link set $VZDEV down
+ print_result
+ fi
fi
for mod in ${NET_MODULES}; do
/sbin/modprobe -r ${mod} > /dev/null 2>&1
--- End Message ---