[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclinux-dev
Subject:    Re: [uClinux-dev] [PATCH] watchdogd: touchup and handle SIGHUP
From:       damico <michele.damico () fitre ! it>
Date:       2008-09-30 9:30:35
Message-ID: 48E1F1BB.4060400 () fitre ! it
[Download RAW message or body]

Mike Frysinger ha scritto:
> On Mon, Sep 29, 2008 at 08:59, damico wrote:
>   
>> Mike Frysinger ha scritto:
>>     
>>> When the reboot program runs, it sends SIGHUP right after SIGTERM, so we
>>> need to handle it as well.
>>>       
>> I'm not sure that SIGHUP signal should be handled while rebooting system.
>> IMHO: sending SIGHUP signal while reboot system is not correct. Maybe, only
>> reboot from sysutils issue a SIGHUP to all process  before sending SIGKILL.
>> For instance reboot from busybox don't issue any SIGHUP signal but just
>> SIGTERM and finally a SIGKILL.
>>     
>
> that doesnt make any sense.  if watchdogd does not handle SIGHUP, the
> default signal handler takes over which means the program exits
> uncleanly and the watchdog device may kick in.  if you want an unclean
> exit, send watchdogd SIGKILL.  which is what the default
> sysutils/reboot.c does after a delay.
>
>   
OK, I understand. It is clear and right : watchdogd MUST catch SIGHUP.

>> 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.
> -mike
>   
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.

So, I'm not smart enough to understand sysvinit's source code :)

Just a question. What is the correct signal that dhcpcd should handle in 
order to send a DHCP_RELEASE to the DHCP server?

Thank you very much.

Regards

--Michele
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic