Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Aug 2019 14:03:34 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Ian Lepore <ian@FreeBSD.org>, Warner Losh <imp@bsdimp.com>, "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>, FreeBSD Current <freebsd-current@FreeBSD.org>, freebsd-rc@FreeBSD.org
Subject:   Re: rc script: manual stop vs system shutdown
Message-ID:  <7a72dcf7-899f-a67b-d66a-cc48a094c7cf@FreeBSD.org>
In-Reply-To: <52b2eac3-83de-a7c7-5126-c742e2f195a8@FreeBSD.org>
References:  <2e50fb67-8a19-412b-19d2-14f5f20b61f8@FreeBSD.org> <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> <CANCZdfpuEuRKMPKTKJkzUg4mwugCV5iUxEEEV0yt%2BZTceZf1dg@mail.gmail.com> <d885a84a-d57c-03b4-72e5-9f37950cfa8e@FreeBSD.org> <c8c862a7ee8998ef44078280f35f0a29354868ff.camel@freebsd.org> <91d1a853-c449-481a-b001-7c1f54e28fdd@FreeBSD.org> <20190812104550.GA2738@kib.kiev.ua> <52b2eac3-83de-a7c7-5126-c742e2f195a8@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7a72dcf7-899f-a67b-d66a-cc48a094c7cf>