Re: restarting DHCP not described in manpages
* Matthew R. Dempsky [EMAIL PROTECTED] [2006-07-11 02:43]: On Mon, Jul 10, 2006 at 12:45:04PM +0200, Henning Brauer wrote: two seconds is too close. due to the weird dhclient architecture (dhclient-script has to die for interface IP configuration!) we have to work with time windows. it is 5 seconds afair. I notice this issue is not limited to starting multiple dhclients within N seconds of each other, but also starting dhclient within N seconds of other's renew time. Is there a better way of reliably restarting dhclient on a single interface than ``pkill -f dhclient: $IF dhclient $IF''? if dhclient called ifconfig directly to configure interfaces instead of going through dhclient-script we would not need the time window... that's the way to go. -- BS Web Services, http://www.bsws.de/ OpenBSD-based Webhosting, Mail Services, Managed Servers, ... Unix is very simple, but it takes a genius to understand the simplicity. (Dennis Ritchie)
Re: restarting DHCP not described in manpages
* Han Boetes [EMAIL PROTECTED] [2006-07-09 20:36]: Karel Kulhavy wrote: I read man dhcp and man dhclient and wasn't able to determine how to restart the DHCP process (or the whole network) if my cable modem with DHCP server crashes and I have to reboot it. I suggest this information to be added, but I don't know where it belongs. Default behaviour for _any_ daemon is the restart on the HUP signal; ie: wrong, the default behaviour upon reception of a HUP signal for any unix program is to terminate (see signal(2)). many daemons do install a sighup handler and react by reloading their configuration. that is certainly not 'default behaviour' tho. blindly sending hup signals to daemons in the hope that they react with config reload is dumb - as the default action is to terminate. -- BS Web Services, http://www.bsws.de/ OpenBSD-based Webhosting, Mail Services, Managed Servers, ... Unix is very simple, but it takes a genius to understand the simplicity. (Dennis Ritchie)
Re: restarting DHCP not described in manpages
* Matthew R. Dempsky [EMAIL PROTECTED] [2006-07-09 22:37]: On Sun, Jul 09, 2006 at 09:22:05PM +0200, Paul de Weerd wrote: Sure, just 'dhclient ${if}'. When 'something' (even another dhclient process) touches the networking config of a dhclient-configured interface, dhclient will exit (as not to change the new config later). Not true. I started five instances of ``dhclient trunk0'' on my laptop two seconds apart, and all five are still running: two seconds is too close. due to the weird dhclient architecture (dhclient-script has to die for interface IP configuration!) we have to work with time windows. it is 5 seconds afair. -- BS Web Services, http://www.bsws.de/ OpenBSD-based Webhosting, Mail Services, Managed Servers, ... Unix is very simple, but it takes a genius to understand the simplicity. (Dennis Ritchie)
Re: restarting DHCP not described in manpages
On Mon, Jul 10, 2006 at 12:45:04PM +0200, Henning Brauer wrote: two seconds is too close. due to the weird dhclient architecture (dhclient-script has to die for interface IP configuration!) we have to work with time windows. it is 5 seconds afair. I notice this issue is not limited to starting multiple dhclients within N seconds of each other, but also starting dhclient within N seconds of other's renew time. Is there a better way of reliably restarting dhclient on a single interface than ``pkill -f dhclient: $IF dhclient $IF''?
restarting DHCP not described in manpages
I read man dhcp and man dhclient and wasn't able to determine how to restart the DHCP process (or the whole network) if my cable modem with DHCP server crashes and I have to reboot it. I suggest this information to be added, but I don't know where it belongs. CL
Re: restarting DHCP not described in manpages
Karel Kulhavy wrote: I read man dhcp and man dhclient and wasn't able to determine how to restart the DHCP process (or the whole network) if my cable modem with DHCP server crashes and I have to reboot it. I suggest this information to be added, but I don't know where it belongs. Default behaviour for _any_ daemon is the restart on the HUP signal; ie: $ sudo pkill -HUP dhcpd # Han
Re: restarting DHCP not described in manpages
On Sun, Jul 09, 2006 at 08:31:46PM +0159, Han Boetes wrote: | Karel Kulhavy wrote: | I read man dhcp and man dhclient and wasn't able to determine | how to restart the DHCP process (or the whole network) if my | cable modem with DHCP server crashes and I have to reboot it. I | suggest this information to be added, but I don't know where it | belongs. | | Default behaviour for _any_ daemon is the restart on the HUP | signal; ie: | |$ sudo pkill -HUP dhcpd From dhcpd(8) : BUGS We realize that it would be nice if one could send a SIGHUP to the server and have it reload the database. This is not technically impossible, but it would require a great deal of work, our resources are extremely limit- ed, and they can be better spent elsewhere. So please don't complain about this on the mailing list unless you're prepared to fund a project to implement this feature, or prepared to do it yourself. You can restart dhcpd by killing it and restarting it after that. So you should use something like : sudo pkill dhcpd; sudo /usr/sbin/dhcpd ${dhcpd_flags} ${dhcpd_ifs} Cheers, Paul 'WEiRD' de Weerd -- [++-]+++.+++[---].+++[+ +++-].++[-]+.--.[-] http://www.weirdnet.nl/
Re: restarting DHCP not described in manpages
On Sun, Jul 09, 2006 at 08:31:23PM +0159, Han Boetes wrote: Karel Kulhavy wrote: I read man dhcp and man dhclient and wasn't able to determine how to restart the DHCP process (or the whole network) if my cable modem with DHCP server crashes and I have to reboot it. I suggest this information to be added, but I don't know where it belongs. Default behaviour for _any_ daemon is the restart on the HUP signal; ie: $ sudo pkill -HUP dhcpd The OP seems interested in restarting dhclient too, but SIGHUP kills dhclient.
Re: restarting DHCP not described in manpages
On 7/9/06, Karel Kulhavy [EMAIL PROTECTED] wrote: I read man dhcp and man dhclient and wasn't able to determine how to restart the DHCP process (or the whole network) if my cable modem with DHCP server crashes and I have to reboot it. I suggest this information to be added, but I don't know where it belongs. CL My cable modem dies every other day. After I reboot the modem, I just ssh into my router and run dhclient on the interface. `sudo dhclient dc0` -saltmiser
Re: restarting DHCP not described in manpages
On 7/9/06, Matthew R. Dempsky [EMAIL PROTECTED] wrote: On Sun, Jul 09, 2006 at 08:31:23PM +0159, Han Boetes wrote: Karel Kulhavy wrote: I read man dhcp and man dhclient and wasn't able to determine how to restart the DHCP process (or the whole network) if my cable modem with DHCP server crashes and I have to reboot it. I suggest this information to be added, but I don't know where it belongs. Default behaviour for _any_ daemon is the restart on the HUP signal; ie: $ sudo pkill -HUP dhcpd The OP seems interested in restarting dhclient too, but SIGHUP kills dhclient. Actually, the way I read the original post, the OP is already restarting the DHCP server when he/she power cycles the cable modem with DHCP server. Thus, he/she just wants to restart the DHCP client. Is there not an equivalent to the Linux ifdown eth0, followed by an ifup eth0 to obtain another lease and IP address? -Todd
Re: restarting DHCP not described in manpages
On Sun, Jul 09, 2006 at 06:57:35PM +, Todd Alan Smith wrote: | Actually, the way I read the original post, the OP is already | restarting the DHCP server when he/she power cycles the cable modem | with DHCP server. Thus, he/she just wants to restart the DHCP client. | Is there not an equivalent to the Linux ifdown eth0, followed by an | ifup eth0 to obtain another lease and IP address? Sure, just 'dhclient ${if}'. When 'something' (even another dhclient process) touches the networking config of a dhclient-configured interface, dhclient will exit (as not to change the new config later). Bringing down your interface is a bit overkill. And if it's overkill you want, you can just reboot your machine to obtain another lease. Cheers, Paul 'WEiRD' de Weerd -- [++-]+++.+++[---].+++[+ +++-].++[-]+.--.[-] http://www.weirdnet.nl/
Re: restarting DHCP not described in manpages
On Sun, Jul 09, 2006 at 09:22:05PM +0200, Paul de Weerd wrote: Sure, just 'dhclient ${if}'. When 'something' (even another dhclient process) touches the networking config of a dhclient-configured interface, dhclient will exit (as not to change the new config later). Not true. I started five instances of ``dhclient trunk0'' on my laptop two seconds apart, and all five are still running: Jul 9 14:34:40 whelp dhclient[5289]: DHCPREQUEST on trunk0 to 192.168.0.12 port 67 Jul 9 14:34:40 whelp dhclient[5289]: DHCPACK from 192.168.0.12 Jul 9 14:34:40 whelp dhclient[5289]: bound to 192.168.0.50 -- renewal in 60 seconds. Jul 9 14:34:42 whelp dhclient[20283]: DHCPREQUEST on trunk0 to 192.168.0.12 port 67 Jul 9 14:34:42 whelp dhclient[20283]: DHCPACK from 192.168.0.12 Jul 9 14:34:42 whelp dhclient[20283]: bound to 192.168.0.50 -- renewal in 60 seconds. Jul 9 14:34:44 whelp dhclient[31937]: DHCPREQUEST on trunk0 to 192.168.0.12 port 67 Jul 9 14:34:44 whelp dhclient[31937]: DHCPACK from 192.168.0.12 Jul 9 14:34:44 whelp dhclient[31937]: bound to 192.168.0.50 -- renewal in 60 seconds. Jul 9 14:34:46 whelp dhclient[407]: DHCPREQUEST on trunk0 to 192.168.0.12 port 67 Jul 9 14:34:46 whelp dhclient[407]: DHCPACK from 192.168.0.12 Jul 9 14:34:46 whelp dhclient[407]: bound to 192.168.0.50 -- renewal in 60 seconds. Jul 9 14:34:48 whelp dhclient[13503]: DHCPREQUEST on trunk0 to 192.168.0.12 port 67 Jul 9 14:34:48 whelp dhclient[13503]: DHCPACK from 192.168.0.12 Jul 9 14:34:48 whelp dhclient[13503]: bound to 192.168.0.50 -- renewal in 60 seconds.
Re: restarting DHCP not described in manpages
(I tried sending a similar email to this one about an hour ago, but it has not turned up yet, while other emails sent since then have appeared on the mailing list. I apologize if this results in redundant mail.) On Sun, Jul 09, 2006 at 09:22:05PM +0200, Paul de Weerd wrote: Sure, just 'dhclient ${if}'. When 'something' (even another dhclient process) touches the networking config of a dhclient-configured interface, dhclient will exit (as not to change the new config later). Not true. As I type this message, I have 10 dhclients running concurrently on my laptop for the same interface. The cause seems to be that I have setup dhcpd on my network to give my laptop a static IP, so all of the dhclients are trying to set the same IP and don't notice the others running. This would not be a problem (other than the extra network and memory resource usage) were it not for /etc/resolv.conf occasionally getting obliterated.