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); |
From: Jamie C. <jca...@we...> - 2003-09-22 22:45:47
|
On Mon, 2003-09-22 at 18:54, Thomas Weiss wrote: > 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. Thanks for that patch - I will fix webmin in the next release to set ONPARENT for redhat versions 9 and above. Do you know if any other recent distributions (like Mandrake 9.1) have also incorporated the same change? - Jamie |
From: Thomas W. <t....@sc...> - 2003-09-23 07:59:32
|
Jamie Cameron wrote: > On Mon, 2003-09-22 at 18:54, Thomas Weiss wrote: > >>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. > > > Thanks for that patch - I will fix webmin in the next release to set > ONPARENT for redhat versions 9 and above. Do you know if any other > recent distributions (like Mandrake 9.1) have also incorporated the same > change? > > - Jamie Mandrake 9.1 seems also to use ONPARENT. I just downloaded the initscripts-7.06-11mdk.i586.rpm and looked at ./etc/sysconfig/network-scripts/ifup-aliases: $>grep ONPARENT ./etc/sysconfig/network-scripts/ifup-aliases [ "$ONPARENT" != "no" -a "$ONPARENT" != "NO" ] && new_interface; [ "$ONPARENT" != "no" -a "$ONPARENT" != "NO" ] && new_interface; Unfortunately we have no Mandrake box in the office, so I can not make a real test. theo > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > - > Forwarded by the Webmin development list at web...@we... > To remove yourself from this list, go to > http://lists.sourceforge.net/lists/listinfo/webadmin-devel |
From: Martin M. <mar...@de...> - 2003-09-23 08:23:22
|
Moin, moin, ... Thomas Weiss <t....@sc...> wrote: >Unfortunately we have no Mandrake box in the office, so I can not make a= =20 >real test. Hold on, if possible, as I am just installing a VMWare-Installation with MDK 9.1 ;-) kind regards Martin Mewes --=20 Novacote Flexpack - Division of COIM Deutschland GmbH c/o IT/IS-Department - Hamburg - Germany |
From: Martin M. <mar...@de...> - 2003-09-23 09:33:31
|
Moin, moin, ... Thomas Weiss <t....@sc...> wrote: >>>"Virtual interfaces such as ifcfg-eth0:1 didn't honor ONBOOT=3Dno, = they >>>were always brought up with parent interface." (www.gurulabs.com) >Mandrake 9.1 seems also to use ONPARENT. I just downloaded the=20 >initscripts-7.06-11mdk.i586.rpm and looked at=20 >./etc/sysconfig/network-scripts/ifup-aliases: > >$>grep ONPARENT ./etc/sysconfig/network-scripts/ifup-aliases > [ "$ONPARENT" !=3D "no" -a "$ONPARENT" !=3D "NO" ] && = new_interface; > [ "$ONPARENT" !=3D "no" -a "$ONPARENT" !=3D "NO" ] && = new_interface; > >Unfortunately we have no Mandrake box in the office, so I can not make a= =20 >real test. As MDK is RH-based on MDK 9.1 ONPARENT is needed as well. Just tested it. kind regards Martin Mewes --=20 Novacote Flexpack - Division of COIM Deutschland GmbH c/o IT/IS-Department - Hamburg - Germany |
From: Jamie C. <jca...@we...> - 2003-09-23 12:45:51
|
On Tue, 2003-09-23 at 19:33, Martin Mewes wrote: > Moin, moin, ... > > Thomas Weiss <t....@sc...> wrote: > > >>>"Virtual interfaces such as ifcfg-eth0:1 didn't honor ONBOOT=no, they > >>>were always brought up with parent interface." (www.gurulabs.com) > > >Mandrake 9.1 seems also to use ONPARENT. I just downloaded the > >initscripts-7.06-11mdk.i586.rpm and looked at > >./etc/sysconfig/network-scripts/ifup-aliases: > > > >$>grep ONPARENT ./etc/sysconfig/network-scripts/ifup-aliases > > [ "$ONPARENT" != "no" -a "$ONPARENT" != "NO" ] && new_interface; > > [ "$ONPARENT" != "no" -a "$ONPARENT" != "NO" ] && new_interface; > > > >Unfortunately we have no Mandrake box in the office, so I can not make a > >real test. > > As MDK is RH-based on MDK 9.1 ONPARENT is needed as well. > Just tested it. Thanks for the info. However, I've decided to have webmin always set ONPARENT for virtual interfaces, regardless of the OS. Older versions of redhat will just ignore it, so there is no harm done.. And when it comes to detecting if a virtual interface will be brought up at boot time, webmin will use ONPARENT if it exists, or ONBOOT otherwise. Again, this should work for both old a new versions of Redhat and Mandrake. - Jamie |