From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2248 invoked from network); 15 Feb 2021 08:36:46 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 15 Feb 2021 08:36:46 -0000 Received: (qmail 8733 invoked by uid 89); 15 Feb 2021 08:37:07 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 8726 invoked from network); 15 Feb 2021 08:37:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=WJNArUENRkciIc9SmPu04vMQY3/6LHm30ySLfjkMpMc=; b=aWd93jYZ5QimMfA+Kv4d7pmm5oVjwzJApuyB9M3ffs4hK19gAgc+uPuyNF5stq3pf2 7DOIg3zA5A8Wj3yAncZlBwYDj4GUfsZ0gxoKorEttfFJ7Ds68dC7Q+S3UEmNeS0QOfJM rYNKXj30FbEMFGXZ3HLeA26FsiOLBmSRCEc1JZFt8vnLnuf5xE+RsfCvrc3dTfyQa9ov pYAGyULmY+DGDG7cUyqmQtv/4pbDd2q0IMFnWYWO234Q2wLK7xoHFEEjXOj38u9zeyls v7LynBJ7Au5WMXVXMp73tfHUFt0T3V3OBCn8eCf3z4nGJ2CixTeydWB4zHSE7ZhxfmYF aK4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=WJNArUENRkciIc9SmPu04vMQY3/6LHm30ySLfjkMpMc=; b=BrQuvpAuKFxZGZve47zyf4WYphN25Y2AHZJ9zuC2nuPtBTicKHdICeSR8JeSU9O6Iu qRr9hDO6g8UZC3EOB+EaSA+TVtbmnaF3meTH4IRO0FpDUsYm04m0d8kzLa32vKts+zv+ E23QMED4JkFATuqDx13BF35EqIMWk1VVzVlFYOFf5BRx9dKpjk3kkCE5wVJGI48c0C4V J0gh15N2eaC+cTABZWBHnaWtVnta4sIrM33zbQLd4DO6aypADUDE2Q0NG2zgR00L6bi6 r9eCeAefl6AYAV2eOCXobpw6vQ5bRhyYJbxMfEyvKRoZhXcxsouXU4yJWpGXitQIyM9T KTuQ== X-Gm-Message-State: AOAM5313rs2gfPa28Vt9+o78cZrlcJtw+s68fYB/F5dLDEFuf4ySG33T 16zsZOoQmKrdAM/s1eVCb+ik5fRWlDo= X-Google-Smtp-Source: ABdhPJwml9eWnKF6pDjsWkdvu6+wNEnh9y5lAWWym/uPuU5uDhm1noOvbIli5O15ARREH1Ltt3pLNw== X-Received: by 2002:a05:6512:1195:: with SMTP id g21mr7694542lfr.512.1613378199837; Mon, 15 Feb 2021 00:36:39 -0800 (PST) From: "Casper Ti. Vector" X-Google-Original-From: "Casper Ti. Vector" Date: Mon, 15 Feb 2021 16:36:33 +0800 To: supervision@list.skarnet.org Subject: Re: Some suggestions on old-fashioned usage with s6 2.10.x Message-ID: Mail-Followup-To: supervision@list.skarnet.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: (I am extremely sorry for delaying this mail so much. I have just done two major refactoring/overhaul projects in this vacation around the Spring Festival, and still have one remaining. These projects are a part of my formal occupation, but I would not have much low-distraction time best for this kind of work apart from vacations. By the way, Happy Chinese "Niu" Year.) On Fri, Jan 29, 2021 at 03:48:09PM +0000, Laurent Bercot wrote: > Bear in mind that my eventual goal for s6 is distro adoption. And > distro maintainers will find any and every excuse to reject it. > Having a "shutdown" command that works exactly like sysvinit's > shutdown is essential, because it deals with a major objection, which > is incompatibility and user-unfriendliness. I do not really understand their excuse here. CLI incompatibility is trivially solvable by creating links (or so) for `halt' / `poweroff' / `reboot', and even the `shutdown' command can be a wrapper for an `atd' based mechanism. In case they complain about the implementation of the CLI, the actual interface to `shutdownd' is not that similar to the `telinit' interface (at least to the one I think it is) either. > The *absence* of a supervision tree after stage 2 is precisely what > requires careful handling, and runit only works because Linux has > that peculiarity that kill -9 -1 does not kill the emitter! > Having a supervision tree in stage 3 actually *helps* with the > late shutdown procedure: shutdownd dies right after the kill (which > would make it usable even on a system without the Linux specialcase) > and is restarted by the supervisor for stage 4. If I understand it correctly, letting `s6-svscan' exec() stage 3 also achieves immunity to `kill -KILL -1'. I also find this "old-fashioned" approach conceptually and implementationally simpler than an army of `s6-supervise' restarting only to be killed again, and a `shutdownd' restarting to execute the halting procedure (see some kind of "state" here? Functional programmers do not hate it for nothing). I know this seems less recoverable than the `shutdownd' approach, but does that count as a reason strong enough to warrant the latter approach, if the halting procedure has already been distilled to its bare essentials and is virtually immune to all non-fatal problems (that is, excluding something as severe as the absence of a `reboot -f' implementation)? > [...] More seriously, you're being unfair, because you're not locked > in at all. You can use the new s6-linux-init and *still* do everything > you were doing before: [...] > Besides, when systemd advocates paint sysv-rc shell scripts as > "duct tape", they're *right*. sysv-rc (and OpenRC) scripts are loaded > with boilerplate that only exists to compensate for the lack of a > supervision infrastructure, and systemd, like any supervision system, > does away with that. systemd has 99 problems, but rightly calling out > oversized script scaffoldings ain't one. Its disingenuousness lies in > pretending that an overengineered, opaque, all-encompassing, unescapable > framework is better than the duct tape; and I think you'll find that > s6-linux-init isn't quite the monster you seem to believe it is. What I intend to express is that unconditionally correlating "a bunch of [...] scripts" to "a 'screwdriver and duct tape' feel" is a typical systemd fallacy. You seemed to be confusing "scripts containing lots of boilerplate" with "scripts that are minimised and clear". > So basically, all you're complaining about is that s6-linux-init-maker > is not generating your preferred run-image layout out-of-the-box > anymore. Well, you're an advanced user, you know what you are doing; > the knobs and levers are *still all there*. The only binary that > kinda hardcodes things is s6-linux-init itself, and if you give it a > try, I'm pretty sure you'll like it, because there was never any reason > to modify the core of stage 1 in the first place and what it does is > what any kind of stage 1 needs to do, no matter what language it's > written in. According to Guillermo's observation about the behavioural similarity between slew's `rc.boot'/`rc.halt' and the current mechanism with s6-linux-init, if I understand the big picture correctly enough, the fundamental difference between the approaches might be the difference in languages (to avoid further digression, here I expressly avoid talking about Lisp ;) and the attendant difference in dependencies. Speaking of the latter, I do not find declaring dependence on things like `rc' and BusyBox really a problem to any packager of systemd. Speaking of the former, the "old-fashioned" approach is obviously more flexible; I have also said that it is probably shorter and perhaps clearer. -- My current OpenPGP key: RSA4096/0x227E8CAAB7AA186C (expires: 2022.09.20) 7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C