Re: [Cooker] Big bug in initscripts: /etc/sysconfig/ifup

2000-09-13 Thread Pedro Rosa

Chmouel Boudjnah wrote:

 
 and isn't the dhcp job to set the gateway ?
Not only... It also sets the netmask. Why then would DHCP be for? A
server just feeding worstation numbers would be a stupid nonsense.
Specially for mobile stuff (ex. notebooks). A change on general
architecture of the network and you have tens or even hundreds of
workstations going crazy. Just think that you need, for some reason, to
set a new router as main... 

On our nets even DNS servers addresses are served through DHCP. Most of
the info we give the worksations stops here: ip number + netmask +
gateway + DNS server. Some other DHCP server/clients go even further
than this.

 
 --
 MandrakeSoft Inc http://www.chmouel.org
 Paris, France --Chmouel

Ektanoor




[Cooker] Big bug in initscripts: /etc/sysconfig/ifup

2000-09-12 Thread Reinhard Katzmann

Hi!

I have big problems with my network setup. I get my IP-Adress
from a DHCP Server (which works fine) but my default route
never gets set. After digging for a while I found the reason
for it in the ifup-Skript in /etc/sysconfig/ifup.
(I can't say if this worked in Mandrake 7.1, but it worked in
older distributions like RH6.2).
Here are the offending lines with my comments:
Starting with line 110:

DHCP_ARGS=
if [ "XXX$DHCP_CLIENT" != "XXX" ];then
case $(basename $DHCP_CLIENT) in
dhcpcd)
[ -n "$DHCP_HOSTNAME" ]  DHCP_ARGS="-h $DHCP_HOSTNAME"
[ -n "$NEEDHOSTNAME" ]  DHCP_ARGS="$DHCP_ARGS -H"
DHCP_ARGS="$DHCP_ARGS $DEVICE"
;;
pump)
[ -n "$DHCP_HOSTNAME" ]  DHCP_ARGS="-h $DHCP_HOSTNAME"
[ -n "$NEEDHOSTNAME" ]  DHCP_ARGS="$DHCP_ARGS --lookup-hostname"
DHCP_ARGS="$DHCP_ARGS -i $DEVICE"
;;
dhcpxd)
# Dhcpxd don't support NEED_HOSTNAME ? guess i need time to patch
# this animal
[ -n "$DHCP_HOSTNAME" ]  DHCP_ARGS="-H $HOSTNAME"
DHCP_ARGS="$DHCP_ARGS $DEVICE"
;;
dhclient)
# Can't specify a host with dhclient ? same remark for
# $NEEDHOSTNAME this client suck !!!
DHCP_ARGS="$DEVICE"
;;
esac
fi

As you see, DHCP_ARGS never get a hint of the default gateway.
and now what comes next (line 138):

if [ -n "$DYNCONFIG" ]; then
echo -n "Determining IP information for $DEVICE via $(basename $DHCP_CLIENT)..."
if $DHCP_CLIENT $DHCP_ARGS ; then
echo " done."
else
echo " failed."
exit 1
fi
else 
if [ -z "$NETMASK" ]; then

...

in this else part the GATEWAY variable from /etc/sysconfig/network
is used for adding the route but as I use DHCP is used this never gets
reached. To correct this bug you have to move line 169 - 178 out of the 
else clause. (I don't see any reason why this is done in such a way).

Best regards,

Reinhard Katzman
--
E-Mail: [EMAIL PROTECTED]




Re: [Cooker] Big bug in initscripts: /etc/sysconfig/ifup

2000-09-12 Thread Chmouel Boudjnah

Reinhard Katzmann [EMAIL PROTECTED] writes:

 in this else part the GATEWAY variable from /etc/sysconfig/network
 is used for adding the route but as I use DHCP is used this never gets
 reached. To correct this bug you have to move line 169 - 178 out of the 
 else clause. (I don't see any reason why this is done in such a way).

i don't understand as you read the default gateway is set only when
using DYNCONFIG (aka: BOOTPROTO=dhcp), maybe there is a bug if you use
bootp, right ?

what is your /etc/sysconfig/network ?

-- 
MandrakeSoft Inc http://www.chmouel.org
Paris, France --Chmouel




Re: [Cooker] Big bug in initscripts: /etc/sysconfig/ifup

2000-09-12 Thread Reinhard Katzmann

Hi Chmouel!

 Reinhard Katzmann [EMAIL PROTECTED] writes:
 
  in this else part the GATEWAY variable from /etc/sysconfig/network
  is used for adding the route but as I use DHCP is used this never gets
  reached. To correct this bug you have to move line 169 - 178 out of the 
  else clause. (I don't see any reason why this is done in such a way).
 
 i don't understand as you read the default gateway is set only when
 using DYNCONFIG (aka: BOOTPROTO=dhcp), maybe there is a bug if you use
 bootp, right ?

No, when using DYNCONFIG the GATEWAY variables are ignored (as they are
only recogniced in the else clause, i.e. no DYNCONFIG (bootp/dhcp, both
the same probably).

 what is your /etc/sysconfig/network ?

NETWORKING=yes
FORWARD_IPV4="yes"
HOSTNAME="pc-suamor"
DOMAINNAME=localdomain
GATEWAY="192.168.0.3"
GATEWAYDEV=""
NISDOMAIN=""

Best regards,

Reinhard Katzmann
--
E-Mail: [EMAIL PROTECTED]




Re: [Cooker] Big bug in initscripts: /etc/sysconfig/ifup

2000-09-12 Thread Chmouel Boudjnah

Reinhard Katzmann [EMAIL PROTECTED] writes:

 No, when using DYNCONFIG the GATEWAY variables are ignored (as they are
 only recogniced in the else clause, i.e. no DYNCONFIG (bootp/dhcp, both
 the same probably).

and isn't the dhcp job to set the gateway ?

-- 
MandrakeSoft Inc http://www.chmouel.org
Paris, France --Chmouel




Re: [Cooker] Big bug in initscripts: /etc/sysconfig/ifup

2000-09-12 Thread Reinhard Katzmann

On Tue, Sep 12, 2000 at 01:30:28PM +0200, Chmouel Boudjnah wrote:
 Reinhard Katzmann [EMAIL PROTECTED] writes:
 
  No, when using DYNCONFIG the GATEWAY variables are ignored (as they are
  only recogniced in the else clause, i.e. no DYNCONFIG (bootp/dhcp, both
  the same probably).
 
 and isn't the dhcp job to set the gateway ?

Well then pump does a very bad job indeed :-(
Ok, I replaced pump by dhcpcd (which is smaller anyway ;) and it works,
at least when plainly starting. Resarting the network (/etc/init.d/network restart)
fails:

Sep 12 13:43:06 pc-suamor ifup:  done.
Sep 12 13:43:06 pc-suamor network: Bringing up interface eth0:  succeeded
Sep 12 13:43:44 pc-suamor pumpd[2318]: renewed lease for interface eth0
Sep 12 13:43:59 pc-suamor network: Shutting down interface eth0:  succeeded
Sep 12 13:44:00 pc-suamor network: Disabling IPv4 packet forwarding:  succeeded
Sep 12 13:44:00 pc-suamor sysctl: error: 'kernel.sysrq' is an unknown key
Sep 12 13:44:00 pc-suamor sysctl: error: 'net.ipv4.tcp_timestamp' is an unknown key
Sep 12 13:44:00 pc-suamor network: Setting network parameters:  succeeded
Sep 12 13:44:00 pc-suamor ifup: SIOCADDRT: Das Netzwerk ist nicht erreichbar
Sep 12 13:44:00 pc-suamor network: Bringing up interface lo:  succeeded
Sep 12 13:44:00 pc-suamor network: Enabling IPv4 packet forwarding succeeded
Sep 12 13:44:00 pc-suamor ifup: Determining IP information for eth0 via dhcpcd...
Sep 12 13:44:00 pc-suamor ifup:  failed.
Sep 12 13:44:00 pc-suamor ifup:   /sbin/dhcpcd: already running
Sep 12 13:44:00 pc-suamor ifup:   /sbin/dhcpcd: if not then delete 
/var/run/dhcpcd-eth0.pid file
Sep 12 13:44:00 pc-suamor network: Bringing up interface eth0:  failed
Sep 12 13:44:00 pc-suamor dhcpcd[31330]: terminating on signal 1 

The interface is gone now. A simple start will bring it up again.. strange 
After a new start still some errors (warnings ?) remain:

Sep 12 13:44:15 pc-suamor network: Disabling IPv4 packet forwarding:  succeeded
Sep 12 13:44:19 pc-suamor sysctl: error: 'kernel.sysrq' is an unknown key
Sep 12 13:44:19 pc-suamor sysctl: error: 'net.ipv4.tcp_timestamp' is an unknown key
Sep 12 13:44:19 pc-suamor network: Setting network parameters:  succeeded
Sep 12 13:44:20 pc-suamor ifup: SIOCADDRT: Das Netzwerk ist nicht erreichbar
Sep 12 13:44:20 pc-suamor network: Bringing up interface lo:  succeeded
Sep 12 13:44:20 pc-suamor network: Enabling IPv4 packet forwarding succeeded
Sep 12 13:44:20 pc-suamor ifup: Determining IP information for eth0 via dhcpcd...
Sep 12 13:44:24 pc-suamor ifup:  done.
Sep 12 13:44:24 pc-suamor network: Bringing up interface eth0:  succeeded
Sep 12 13:44:53 pc-suamor pumpd[2318]: renewed lease for interface eth0

I have a plain kernel 2.2.18pre3 (with reiserfs patch), so maybe some kernel
patch is needed for the messages going away.

Best regards,

Reinhard Katzmann
--
E-Mail: [EMAIL PROTECTED]