From: Thomas W. <t....@sc...> - 2003-09-22 08:54:45
|
Hello, I think there is a little bug in the network module for redhat? Redhat 9: To activate or deactivate virtual interfaces at boot time, RH uses the variable ONPARENT and not on ONBOOT (ONBOOT is used only for "real" interfaces). Redhat <9: "Virtual interfaces such as ifcfg-eth0:1 didn't honor ONBOOT=no, they were always brought up with parent interface." (www.gurulabs.com) Have a look at /etc/sysconfig/network-scripts/ifup-aliases and http://www.gurulabs.com/RedHatLinux9-review.html. I tried to fix it for RH-9. (For RH < 9 can_edit has also to be fixed?) Perhaps the patch is useful for others too. theo diff -Naur net-110-org/redhat-linux-lib.pl net-110/redhat-linux-lib.pl --- net-110-org/redhat-linux-lib.pl Fri Sep 19 13:22:59 2003 +++ net-110/redhat-linux-lib.pl Fri Sep 19 15:35:39 2003 @@ -40,7 +40,12 @@ $b->{'virtual'} = $2; } else { $b->{'name'} = $b->{'fullname'}; } - $b->{'up'} = ($conf{'ONBOOT'} eq 'yes'); + if ( $b->{'virtual'} ne "" ){ + $b->{'up'} = ($conf{'ONPARENT'} !~ /^\s*no\s*$/i); + } + else { + $b->{'up'} = ($conf{'ONBOOT'} eq 'yes'); + } $b->{'address'} = $conf{'IPADDR'}; $b->{'netmask'} = $conf{'NETMASK'}; $b->{'broadcast'} = $conf{'BROADCAST'}; @@ -88,7 +93,13 @@ delete($conf{'GATEWAY'}); } $conf{'MTU'} = $_[0]->{'mtu'}; -$conf{'ONBOOT'} = $_[0]->{'up'} ? "yes" : "no"; +if ( $_[0]->{'virtual'} ne "" ){ + $conf{'ONPARENT'} = $_[0]->{'up'} ? "yes" : "no"; + $conf{'ONBOOT'} = 'value not used'; +} +else { + $conf{'ONBOOT'} = $_[0]->{'up'} ? "yes" : "no"; +} $conf{'BOOTPROTO'} = $_[0]->{'bootp'} ? "bootp" : $_[0]->{'dhcp'} ? "dhcp" : "none"; &write_env_file("$net_scripts_dir/ifcfg-$name", \%conf); |