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=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 186A320F20 for ; Tue, 2 Apr 2024 06:42:16 +0200 (CEST) Received: (qmail 23904 invoked by uid 89); 2 Apr 2024 04:42:41 -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 23890 invoked from network); 2 Apr 2024 04:42:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712032931; x=1712637731; darn=list.skarnet.org; h=mime-version:message-id:date:user-agent:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=OdtuNGNQYLgHDGIMHP8NzKlEtn0yATLaBIs4cxx1nBU=; b=RHjlWt3QnUw07cBDwiBOFOwJl55deLiaGw4tC0xlHGj8aiD1pIqaOGT63c42JtKEGi SuDlikghT6FDYJSbaUcWX5D9fe77dqzunVDvUuXS4/HRJpslEuLyasxnqy0Sk9j25g8W TGUrNXdNfrZfnE/tdGKw1RQuwnVJlH54DS3JNMUYzRG8prv44b4xQiSEiJ+moNpz+/gt 2TeWuJXKOFbPUL7WNJwHdm+sgxS31r/xZI6gE9Utto2vXfVQRAe/godCyFy0MHmWc679 un+fcmr4VJpGYbmT4ZHWPqEcS//qtkGuVz8CDx9yXLdPrcvEDaqpb8Ye92qs+iaXILAv AE2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712032931; x=1712637731; h=mime-version:message-id:date:user-agent:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OdtuNGNQYLgHDGIMHP8NzKlEtn0yATLaBIs4cxx1nBU=; b=ePXqZyWBRvLGNmdGjNrqRcnYxb7ahcpSVRKbyXH0RmB+2oiC1Tc/ntvAC4wQ4nuhNe 9tb51csROIfYprEWiq33U5QB3d9ikHSE8arGljhN6lm599mXPVEpMmel11TIFODVT7+/ FCIm40CFCcAqcpa7nlc1+N/a9sTtfHCWDSH54+MIEt3GBXa3NZTNCZd5WHY9UrUHU/3i 2jWXYXyT5yMT/98ueBoAk1cf9dxdB/T7IeVSOHvfgAcREHWNQu/+4gZYEsvKIIgeO3vp QxFqNQe/+jkGc+jn3ZNuBs/wgFDKQzOhWs7tsxbXwfCMI7rlo2jKOEti5vyyJO3bGIlN S6NA== X-Forwarded-Encrypted: i=1; AJvYcCWZ81bIkD0U8HRnzgor7i6rJhjqGjm+LTI9hB8lVBLWrmM9rdZb8Qn8v0cY4CBWoeZIYeq9zVNo67vl2QoTdePsTu0/fxr7B9A= X-Gm-Message-State: AOJu0YyZDIjri/GLq6tj+00Q9k3hlCeon2TPZu1L+PG3nLNKlyR0PdNm n94MMYRLFIIsRkhc7okMQI4yKh9qezUADrHuSXyADRBoKDAQMIWnQjznAFLF X-Google-Smtp-Source: AGHT+IGaKvxUkI8zFkflhi5OKl2jGyfl72IP/A4ghbm88PqAiuqYKwACiNKR2BGmQqvIKfiVleoDEA== X-Received: by 2002:a17:90b:3842:b0:2a2:c16:d673 with SMTP id nl2-20020a17090b384200b002a20c16d673mr10531034pjb.36.1712032930633; Mon, 01 Apr 2024 21:42:10 -0700 (PDT) From: Alexis To: supervision , skaware Subject: s6-rc user services on Gentoo User-Agent: mu4e 1.12.2; emacs 29.3 Date: Tue, 02 Apr 2024 15:42:06 +1100 Message-ID: <87jzlgnzoh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Hi all, Laurent has suggested i ask on IRC about this, but since (a) i'm in UTC+10, (b) i'm constantly moving between a few different networks, and (c) my bouncer is currently out of action (it's a Story), i thought i'd ask on these lists instead, to facilitate asynchronous replies. :-) When i was on Void, a few years ago, i used s6+66 in place of runit. Since moving to Gentoo, i've been using OpenRC. OpenRC currently doesn't have user services. They're gradually being worked on: https://github.com/OpenRC/openrc/pull/573 but the current state of things is that the contributor is rewriting the PR: https://github.com/OpenRC/openrc/pull/573#issuecomment-2007766162 i've had a lot on my plate for a while, but in more recent times i've had a bit more space to faff around with lower-priority stuff, and so i'm exploring setting up s6-rc to manage the user services i need. Once i've done so, i can: * write a guide on the Gentoo wiki[a]; and * provide service definitions for others to use via my personal overlay[b]. which might help more people to become familiar with the s6 ecosystem in general, and with s6-rc in particular (rather than trying to use s6 for service management as well as supervision). However, i've reached an impasse, and i'm hoping some can tell me what i'm missing / what i'm doing wrong / what i'm misunderstanding. Here's the situation: * S6RC_SERVICE_REPO=${HOME}/src/srht/gentoo-overlay/sys-apps/s6-rc-services/files/ * The above directory contains two service directories: ** dbus-session-bus/, containing: *** type: longrun *** notification-fd: 3 *** producer-for: dbus-session-bus-log *** run: #!/usr/bin/execlineb -P importas HOME HOME redirfd -w 4 ${HOME}/.env.d/DBUS_SESSION_BUS_ADDRESS dbus-daemon --session --fork --nopidfile --print-address=4 *** finish: #!/usr/bin/execlineb -P importas HOME HOME rm -f ${HOME}/.env.d/DBUS_SESSION_BUS_ADDRESS ** dbus-session-bus-log/, containing: *** type: longrun *** notification-fd: 3 *** consumer-for: dbus-session-bus *** pipeline-name: dbus-session-bus-pipeline *** run: #!/usr/bin/execlineb -P importas HOME HOME exec -c s6-log -d3 -- t ${HOME}/.logs/s6-rc-services/dbus-session-bus * SCANDIR="${XDG_DATA_HOME}/s6-rc/services" * The above directory contains symlinks to ${S6RC_SERVICE_REPO}/{dbus-session-bus,dbus-session-bus-log} * S6RC_COMPILED="${XDG_STATE_HOME}/s6-rc/compiled" * Running: s6-rc-compile "${S6RC_COMPILED}" "${SCANDIR}" completes successfully. * Running s6-svscan -- "${SCANDIR}" succeeds, with two s6-supervise processes created. * HOWEVER, running s6-rc-init -c "${S6RC_COMPILED}" -l "${XDG_RUNTIME_DIR}/s6-rc" "${SCANDIR}" fails, with the error message: unable to supervise service directories in /run/user/1000/s6-rc/servicedirs: File exists i've taken a look at s6rc_livedir_create.c: https://git.skarnet.org/cgi-bin/cgit.cgi/s6-rc/tree/src/libs6rc/s6rc_livedir_create.c but nothing is leaping out to me as explaining what's happening. Thoughts? Alexis. [a] The current s6 and s6-rc pages on the wiki have lot of detail, without any "quickstart" tutorials that might make it easy for people to get on board. A while ago i did a big restructure of the s6 article: https://wiki.gentoo.org/wiki/User:Flexibeast/drafts/S6 which i feel improves the current page: https://wiki.gentoo.org/wiki/S6 but which has been awaiting review by a more senior wiki editor than me. The s6-rc page is similarly detailed and similarly lacking a "quickstart": https://wiki.gentoo.org/wiki/S6-rc [b] Various people are providing s6 service definitions, e.g. https://codeberg.org/alecStewart1/gentoo-s6-scripts, but i'm not currently aware of any providing s6-rc service definitions - pointers welcome. :-)