rc script: manual stop vs system shutdown
Andriy Gapon
avg at FreeBSD.org
Thu Aug 1 18:15:05 UTC 2019
On 01/08/2019 19:12, Warner Losh wrote:
>
>
> On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes
> <freebsd-rwg at gndrsh.dnsmgr.net <mailto:freebsd-rwg at gndrsh.dnsmgr.net>>
> wrote:
>
> >
> > Is it possible in an rc script to distinguish between a manual stop
> > (e.g., service foo stop) and a stop during a system shutdown (via
> > rc.shutdown) ?
> > Are there any marker variables for that?
> > Or something in the global system state?
>
> Not that I can think of, but I like this idea,
> I am sure that use cases exist.
>
>
> What is the use case that needs to disambiguate the two cases...
I have one use case in mind and it's a truly special case.
I want rc.d/watchdogd to gracefully stop watchdogd and to disable the
watchdog timer when the stop action is requested manually. And I want
it to stop watchdogd and set the watchdog timer to a special shutdown
timeout during the shutdown. If the special timeout is configured, of
course.
--
Andriy Gapon
More information about the freebsd-current
mailing list