You are not logged in.

#1 2009-08-24 09:48:08

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

[SOLVED] netcfg - adding --reboot option to dhcpcd

Flyspray is still down and I've already forgotten one bug I wanted to file, so I'm posting this here to remind me as well as get others thoughts tongue

I just had a metric ass-truckload of problems getting a DHCP lease with netcfg on my home wireless (a configuration I've had for many months) because dhcpcd kept making DHCPREQUEST's for the previous lease it had at my friends house (as if the --request option had been passed. My DHCP server ignored the REQUEST's because it's not authorative for the network it was requesting -- this is all correct. However dhcpcd never fell back to making a DHCPDISCOVER broadcast like the man page says it's supposed to when it doesn't get a response for the REQUEST. netcfg then borked out with a dhcp timed out error.

I had to remove the file /var/lib/dhcpcd/dhcpcd-wlan0.leases before it would work.

I'm suggesting that netcfg should call dhcpcd with the --reboot 0 option in /usr/lib/network/ethernet.subr to prevent dhcpcd starting with the DHCPREQUEST and always starting with DHCPDISCOVER. Or at least make that a user-configurable option. I would just hack my copy of the file, but I know it will be overwritten next upgrade.

What do other people think?

Last edited by fukawi2 (2009-08-26 00:10:29)

Offline

#2 2009-08-24 10:26:21

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: [SOLVED] netcfg - adding --reboot option to dhcpcd

I've been working with the git version of netcfg for a while now, so I may not be tracking what's in the release version.

But can't you already supply a DHCP_OPTIONS argument in your profiles? whatever you put there will be expanded into the other stuff netcfg uses.

Offline

#3 2009-08-24 13:19:58

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: [SOLVED] netcfg - adding --reboot option to dhcpcd

I'd prefer user configurable, as I like this behavior

Offline

#4 2009-08-24 22:52:29

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] netcfg - adding --reboot option to dhcpcd

Profjim wrote:

But can't you already supply a DHCP_OPTIONS argument in your profiles? whatever you put there will be expanded into the other stuff netcfg uses.

There's nothing in the wiki page about netcfg, and /etc/networks.d/examples/complete.example appears to have been removed from the latest versions of netcfg. Is this a valid configuration var?

I guess worse case I could just put a PREUP option to rm the leases cache file...

Offline

#5 2009-08-25 02:15:01

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: [SOLVED] netcfg - adding --reboot option to dhcpcd

As I said, my head's inside the git version. But if you're using the ethernet connection, just open up /usr/lib/network/connections/ethernet and grep for dhcpcd. Doesn't it look something like this:

            # If using own dns, tell dhcpcd to NOT replace resolv.conf
            [[ -n "$DNS1" || -n "$DNS" ]] && DHCP_OPTIONS="-C resolv.conf $DHCP_OPTIONS"
            # Start dhcpcd
            dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCP_OPTIONS "$INTERFACE" 2>&1

Offline

#6 2009-08-25 07:15:30

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] netcfg - adding --reboot option to dhcpcd

Yeah that looks right... I presumed DHCP_OPTIONS was built elsewhere in the file / runtime... I take it I can use it in the config too? Didn't think about that smile

Offline

#7 2009-08-25 07:31:33

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: [SOLVED] netcfg - adding --reboot option to dhcpcd

Sure, the config files are just scripts that get sourced, same as /etc/rc.conf.

Offline

#8 2009-08-26 00:10:15

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] netcfg - adding --reboot option to dhcpcd

Sweet, problem solved then big_smile

Offline

Board footer

Powered by FluxBB