Re: s6-rc how to log oneshot services

From: Alex Kiernan <alex.kiernan_at_gmail.com>
Date: Tue, 7 Mar 2023 11:53:45 +0000

On Tue, Mar 7, 2023 at 10:45 AM Daniel Barlow <dan_at_telent.net> wrote:
>
>
> Hi all
>
> I've adopted s6 and s6-rc for a small distro that's targeted at
> consumer wifi routers and similar low-powered devices (same target
> devices as openwrt) and so far I am appreciating the consistency and the
> warm fuzzies that I get from having a supervision tree (and simple
> readiness checks!) instead of a folder full of pid files that may or
> may not correspond with what's actually running.
>

We're very similar... my target has a decent amount of compute, but
still an embedded device with constrained RAM and flash.

> My question is: how should I handle logging for oneshot services? I
> have oneshots doing things that might fail, like configuring network
> interfaces or inserting modules, and I'd like those failure messages to
> go somewhere useful as the longrun messages do. If I just add
> a logging service to a oneshot with producer-for/consumer-for I get
>
> s6-rc-compile: fatal: longrun wlan.module-log declares a producer wlan.module of type oneshot
>
> so I guess that's not the answer ...
>
> What am I missing? I guess I could convert them into longruns that do
> the "up" actions then call pause(2), but that seems a bit of a
> ... non-traditional approach?
>

Interested in the right answer - right now we just have an icky hack
so it just goes to uncaught-logs...

redirfd -w 1 /run/service/s6-svscan-log/fifo

I've not actually checked since we converted PID1 to s6-linux-init if
we still need that - I suspect we may not.

-- 
Alex Kiernan
Received on Tue Mar 07 2023 - 12:53:45 CET

This archive was generated by hypermail 2.4.0 : Tue Mar 07 2023 - 12:54:28 CET