Re: rc script: manual stop vs system shutdown

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Mon, 12 Aug 2019 14:03:34 +0300
On 12/08/2019 13:57, Andriy Gapon wrote:
> On 12/08/2019 13:45, Konstantin Belousov wrote:
>> On Mon, Aug 12, 2019 at 10:46:29AM +0300, Andriy Gapon wrote:
>>> I guess that there is more than one way to achieve what I want or
>>> something similar to that.
>>> Rather than "expend words" on a theoretical discussion, I decided to do
>>> this: https://reviews.freebsd.org/D21221
>>> However, I am still open to the discussion and suggestions.
>>> One thing that I would prefer, though, is to make the watchdogd service
>>> as smart as possible -- but not smarter :-) -- that is, I would prefer
>>> to do without adding any new command verbs to it.
>>
>> Did you considered exporting kern_shutdown.c:rebooting as a sysctl ?
> 
> No, I didn't it.  Thank you for the suggestion.
> Let me investigate it.

'rebooting' seems to be too late, it's set when the actual reboot system
call is made.  rc.shutdown is run before that.
I think that the kernel is generally[*] not aware of an imminent
shutdown between the time init(8) is signaled and the time init(8) calls
reboot(2).

[*] -- except for cases where the kernel is an initiator of the shutdown.


-- 
Andriy Gapon
Received on Mon Aug 12 2019 - 09:03:42 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:21 UTC