public inbox for developer@lists.illumos.org (since 2011-08)
 help / color / mirror / Atom feed
From: "Joshua M. Clulow" <josh@sysmgr.org>
To: illumos-developer <developer@lists.illumos.org>
Subject: Re: [developer] Review - 15665 svc:/network/loopback exits successfully even if it fails
Date: Thu, 1 Aug 2024 01:48:02 -0700	[thread overview]
Message-ID: <CAEwA5nLaDe7jg_DzkHRG8A3RoYcFzkqZ12f9boyx2fj8CrzF0g@mail.gmail.com> (raw)
In-Reply-To: <CAEgYsbEbQOHxZPnyeituctnLnG4pD8rK6c2D0NA=g84V5bsBPQ@mail.gmail.com>

On Wed, 31 Jul 2024 at 02:45, Peter Tribble <peter.tribble@gmail.com> wrote:
> On Tue, Jul 30, 2024 at 11:46 PM Gordon Ross <gordon.w.ross@gmail.com> wrote:
>> Optional dependency does that in SMF, right?
> Well no, that's a rather different case. That is the "I don't care if it's enabled or not,
> but if it is I'll have a hard dependency on it".

That's not what "optional_all" does.  As per smf(7):

  optional_all

    Satisfied if the cited services are running (online or
    degraded) or do not run without administrative action
    (disabled, maintenance, not present, or offline
    waiting for dependencies which do not start without
    administrative action).

Note, most critically, if a service is in the maintenance state, it
will not run without administrative action.  This allows a dependency
with the "optional_all" group to proceed with starting up.

> What we're after here is the "I do care that it's enabled, and must run after it, but I'm
> prepared to live with errors".

That's what "optional_all" does.  It's effectively just for startup
sequencing; i.e., "as long as you believe you're going to start the
service, I'll wait, but if that changes just start me straight away".

I think the important thing to recognise is that dependencies aren't
considering what's marked enabled or disabled, they're considering the
_state_ of services and potentially the _next state_ for services in
transition (e.g., being started or stopped).  It's a subtle but
important distinction because there _is_ a state called "disabled" as
well, but that's separate from whether the service is marked as being
enabled or disabled by the administrator.  After you mark a service as
disabled, it might not hit the "disabled" state for quite some time,
depending on what state it was in to begin with.

The keen reader will note that "not present" is also not a state, but
it's treated like one in the mental model: it's the state implicitly
assumed for services we don't appear to have on the system.  Obviously
services that do not exist will not be able to run without some
administrative action either.

I agree that the degraded state is interesting in the limit, but I do
not believe it is necessary to implement more of it merely to get the
behaviour you're asking for here.


Cheers.

-- 
Joshua M. Clulow
http://blog.sysmgr.org

  reply	other threads:[~2024-08-01  8:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-26  8:20 Andy Fiddaman
2024-07-26 12:44 ` [developer] " Peter Tribble
2024-07-26 13:41   ` Toomas Soome
2024-07-26 14:05     ` Peter Tribble
2024-07-26 13:50   ` Andy Fiddaman
2024-07-26 15:14     ` Peter Tribble
2024-07-26 15:55       ` Jorge Schrauwen
2024-07-30 22:46         ` Gordon Ross
2024-07-31  9:44           ` Peter Tribble
2024-08-01  8:48             ` Joshua M. Clulow [this message]
2024-07-26 18:08       ` Alan Coopersmith
2024-08-07 20:04       ` Andy Fiddaman
2024-09-09 17:36         ` Andy Fiddaman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEwA5nLaDe7jg_DzkHRG8A3RoYcFzkqZ12f9boyx2fj8CrzF0g@mail.gmail.com \
    --to=josh@sysmgr.org \
    --cc=developer@lists.illumos.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).