Hi,
as the length of interfaces aliases is limited and the aliases are
determined by the vservername long vservernames break the suffix concept
of the (util-)vserver tools as the alias is simply truncated and the
suffix is dropped. That means, that vservers with longnames will only
have the last assigned address available, as the others are
consecutively overwritten. The attached patch causes the alias name to
be the vservername truncated to 8 chars to avoid this problem. The
downside is that vservernames have to differ within the first 8 chars
this way instead of `whatever this was before` (guess it was about 10
chars).
Bjoern
diff -NurpP --minimal util-vserver-0.29.4/scripts/vserver util-vserver-0.29.4-new/scripts/vserver
--- util-vserver-0.29.4/scripts/vserver 2004-02-06 23:10:50.000000000 +0100
+++ util-vserver-0.29.4-new/scripts/vserver 2004-04-06 21:59:23.000000000 +0200
@@ -87,6 +87,8 @@ ifconfig_iproot()
# The first IP 1.2.3.4 will go on eth0 and the other on eth1
# VLAN devices are also supported (eth0.231 for vlan 231)
SUFFIX=
+ # Use shortened vservername to avoid alias problems with long names
+ ALIASNAME=`echo $1 | sed "s/\(.\{8\}\).*/\1/"`
for oneip in $IPROOT
do
IPDEV=$IPROOTDEV
@@ -120,7 +122,7 @@ ifconfig_iproot()
IPROOTMASK=$NETMASK
IPROOTBCAST=$BCAST
#echo /sbin/ifconfig $IPDEV:$1$SUFFIX $oneip netmask $IPROOTMASK broadcast $IPROOTBCAST
- /sbin/ifconfig $IPDEV:$1$SUFFIX $oneip netmask $IPROOTMASK broadcast $IPROOTBCAST
+ /sbin/ifconfig $IPDEV:$ALIASNAME$SUFFIX $oneip netmask $IPROOTMASK broadcast $IPROOTBCAST
fi
if [ "$SUFFIX" = "" ] ; then
SUFFIX=1
@@ -137,6 +139,7 @@ ifconfig_iproot_off()
{
if [ "$NODEV" = "" -a "$IPROOT" != "" -a "$IPROOT" != "0.0.0.0" -a "$IPROOT" != "ALL" -a "$IPROOTDEV" != "" ] ;then
SUFFIX=
+ ALIASNAME=`echo $1 | sed "s/\(.\{8\}\).*/\1/"`
for oneip in $IPROOT
do
IPDEV=$IPROOTDEV
@@ -146,7 +149,7 @@ ifconfig_iproot_off()
eval `echo $oneip | tr : ' ' | (read dev ip; echo IPDEV=$dev)`
;;
esac
- /sbin/ifconfig $IPDEV:$1$SUFFIX down 2>/dev/null
+ /sbin/ifconfig $IPDEV:$ALIASNAME$SUFFIX down 2>/dev/null
if [ "$SUFFIX" = "" ] ; then
SUFFIX=1
else