The patch is a patch for dhcpcd-1.3.22-pl4. I have submitted a patch to the upstream developer but he seems to be 'missing' so I submit this to gentoo for use until said developer is 'found' again. Problems fixed by this patch: 1) Currently in gentoo dhcpcd is stopped by doing a -k on it. The result of this is that a machine almost always gets a new ip address on reboot. There are cases where this behaviour is unwanted. Some people have proposed to use kill -s SIGTERM to get beyond this, but it is just not clean enough for me. 1-fix) The patch adds a -z option which will shutdown dhcpcd precisely the same as -k except for not removing the cache file which solves the problem. The manpage has also been updated to reflect the new command. 2) In some scenarios a user would want to use his own resolv.conf at work and perhaps a dhcp assigned one at home. If you specify a -R in dhcpcd it will use your current resolv.conf, if not it will backup this file to resolv.conf.sv and replace resolv.conf. Upon shutdown it will replace the resolv.conf file with the original from resolv.conf.sv again. This is all fine and well except for the case where your machine shuts down improperly and resolv.conf.sv is not restored. In such a case you loose your fixed resolv.conf. 2-fix) The patch makes sure that if there is a resolv.conf.sv present from the previous session, it gets restored to resolv.conf before dhcpcd does its normal resolv.conf processing. How to add it: 1) Add the patch file to the files directory and rebuild md5 hashes. 2) Add epatch $FILESDIR/${P}-keepCacheAndResolv.diff to end of src_unpack of the latest ebuild file. 3) Change the standard /etc/init.d/net.eth0 to use -z on stop. Reproducible: Always Steps to Reproduce: Not bug, but patch Expected Results: I have an eth0 with fixed resolv.conf at work and wlan0 with dhcp resolv.conf at home. I always keep the same address when using -z and my resolv.conf works correctly wherever I am.
Created attachment 13812 [details, diff] Patch file for dhcpcd
Thanks for this patch! It will show up in 1.3.22_p4-r1 later today. This will really help us.
Hi, For some reason this patch has been removed from portage. I am now having the same problems as originally. Please add the patch again or if it has problems applying, inform so I can fix. Thank you.
Hmm, let me just check, it looks as if it is still there but not working? Will investigate further.
Will test tonight on my wireless network. Maybe it is net.eth0 related or just my stupidity, will update bug tomorrow.
Ok, found the problem, but not the solution. It appears that the net.eth0 script looks for the pid of dhcpcd before it uses dhcpcd to release the ip. For some reason the pid isn't created as dhcpcd doesn't seem to stay running after configuring the interface. I do not know yet what the problem is, but it is not with the patch. So I'm marking it fixed.