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.

> 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
_______________________________________________
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

Reply via email to