From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from alyss.skarnet.org (alyss.skarnet.org [95.142.172.232]) by inbox.vuxu.org (Postfix) with SMTP id 93CD622999 for ; Thu, 5 Dec 2024 20:44:24 +0100 (CET) Received: (qmail 26790 invoked by uid 89); 5 Dec 2024 19:44:48 -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 26783 invoked from network); 5 Dec 2024 19:44:48 -0000 From: "Laurent Bercot" To: supervision@list.skarnet.org Subject: Re[2]: Have an external script wait for a oneshot service Date: Thu, 05 Dec 2024 19:44:17 +0000 Message-Id: In-Reply-To: <3d1391e4-b240-4675-a839-a34c39d474b3@sopka.ch> References: <20241204140015.4e635037306d88117e053994@freesa.org> <2571a89b-ac74-4d9e-b8c6-ff0fe05cebb7@sopka.ch> <20241204141821.ee2a00c996c948f2feb42dec@freesa.org> <4faed412-6fc0-4833-8f76-b6a74667c869@sopka.ch> <3d1391e4-b240-4675-a839-a34c39d474b3@sopka.ch> Reply-To: "Laurent Bercot" User-Agent: eM_Client/10.1.4588.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable > - 2c A third system-oneshot does: > - 2ci Prepare the live directory for the user-tree for each us= er specified in config C (preferably under /run/user/${USER}). > - 2cii Run "s6-rc-init" and "s6-rc start default" for each use= r specified in config C. > (this can be merged with the instantiation system-oneshot if desire= d.) Okay. My point is, why do you need that "default" bundle here? Why do you want an s6-rc infrastructure active when the user isn't logged in? I can understand a permanent supervision tree per user, but a permanent service set that includes oneshots feels overengineered to me. What problem is this supposed to solve? >- Upon login, a login script L shall invoke an "s6-rc start login" with ("= login" being a bundle) for the user logging in. > (this can be further extended using PAM to run "s6-rc start ${PAM_TYPE}= " to differentiate different types of logins) > The script L can be started by PAM, .profile or in some other way. My advice is to do your whole 2c point at login time. The script L can perform XDG stuff, s6-rc-init, and s6-rc start default. On last logout, you stop everything with "s6-rc -da change" and you delete the livedir. Only the supervision tree remains, maintaining whatever services the user has manually added. I don't think there is a good argument for keeping state (which is what oneshots do) in user services when the user is logged out. Feel free to give counterexamples though. -- Laurent