rc script: manual stop vs system shutdown
Andriy Gapon
avg at FreeBSD.org
Mon Aug 12 11:03:42 UTC 2019
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
More information about the freebsd-current
mailing list