On Tue, Sep 30, 2008 at 05:30, damico wrote: > Mike Frysinger ha scritto: >> On Mon, Sep 29, 2008 at 08:59, damico wrote: >>> I was looking for some specification on shutdown and signals in the net >>> but I haven't found any reliable note on that topic. >> >> there is no such spec >> >>> >>> Just at http://linux.die.net/man/8/shutdown I read about SIGTERM but >>> nowhere >>> I found anything about SIGHUP. >>> >>> Anyway, on dhcpcd README there is a note: >>> [quote] >>> 7. Other Information >>> >>> dhcpcd sends DHCP_RELEASE message to the DHCP server, deletes the >>> /etc/dhcpc/dhcpcd-interface.cache file and brings the attached >>> network interface down when it gets SIGHUP signal. It will >>> not send DHCP_RELEASE message and will not delete >>> /etc/dhcpc/dhcpcd-interface.cache file in a case it gets >>> SIGTERM as normally happens upon reboot. >>> [quote] >>> So, when the system reboot if a SIGHUP signal is sent to dhcpcd the >>> result >>> is that we lost the ip address. >>> I think that the only thing to do is remove from sysutils/reboot.c >>> kill(-1, SIGHUP); >>> >>> I did it one year ago .... Now my devices preserve the ip address when I >>> reboot them ... :) >>> >>> let me know If you have some specifications about the signals that should >>> issue while rebooting system. I can revert my modifications and modify >>> dhcpcd to change its behaviour. >> >> what happens with sysutils/reboot.c doesnt really matter to me. if >> you want to know what the "correct" behavior is, you should just look >> at the sysvinit implementation of reboot. which does send SIGTERM and >> SIGHUP when rebooting. > > I took a look to sysvinit's source code I wasn't able to find where the > SIGHUP signal does send... but I wrote a test code to see what happens on my > debian box and I can see the SIGHUP signal when rebooting.
iirc, sysvinit's reboot tells sysvinit's init to reboot via /dev/initctl ... from there, init itself sends signals and processes the "reboot" runlevel. it's fugly to say the least. > So, I'm not smart enough to understand sysvinit's source code :) i dont think anyone is anymore. it's a big steaming pile of crap. perhaps the new "Linux Plumbers" group and form some kind of sanity here. or perhaps the LSB has made some statement (seems right up their alley). > Just a question. What is the correct signal that dhcpcd should handle in > order to send a DHCP_RELEASE to the DHCP server? no idea ... i dont really track any dhcp project and i'm not terribly familiar with these inner details -mike _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
