>* Is there already a way to find the exit status of oneshots?
Not directly; oneshots are run as scions of the s6-rc-oneshot-runner
service you noticed, this is all part of the s6-rc internal mechanisms.
If you use s6-rc -v2, you will see the exit code of your oneshots in
its logs.
When s6-rc exits nonzero, it means one or more services failed to
transition. You can then compare the list of active services
(s6-rc -a list) to what you expected it to be, and infer the ones that
failed. That's how you can tell something went wrong without parsing
the logs.
Yeah it's convoluted, and I plan to make that a lot easier by having
the right command combos baked in s6-frontend.
>importas -i ETH0_IP4 ETH0_IP4
>importas -i ETH1_IP4 ETH1_IP4
>importas -i ETH2_IP4 ETH2_IP4
>
>If these are passed down from s6-svscan environment, how did they get
>injected there?
Not shown in that example is the s6-linux-init invocation, that
includes all these variables in the environment that is passed to
s6-svscan.
I have since changed the service scripts to have an explicit
"s6-envdir /etc/env-network" at the beginning, so they don't rely on
any specific environment. (And also, it was cleaner not to export all
my IPs to the whole supervision tree!)
I should update the examples directory with a more recent version of my
service scripts - it's been 10 years since the first s6-rc release and
I have acquired some experience on what is good practice and what
doesn't
appear to be. Thanks for the reminder! ^^"
--
Laurent
Received on Mon Apr 07 2025 - 20:40:10 CEST