Re: Have an external script wait for a oneshot service

From: Paul Sopka <psopka_at_sopka.ch>
Date: Wed, 4 Dec 2024 21:05:45 +0100

> You could use `s6-rc -a list`, perhaps? It lists all services that are in the active state.
>
> For example, I have a oneshot service called `swap` that turns on or off swap volumes.
>
> # s6-rc -a list | grep swap
> swap
> # s6-rc stop swap
> # s6-rc -a list | grep swap
> #
>
> I could run `grep -q swap` and then the exit status would tell me if it's running or not.
>
> Does that give you what you want?
Unfortunately not, since I specifically need to *wait*
and waiting based on "state-info" would require polling,
which I would rather avoid.

Regards

Paul

Received on Wed Dec 04 2024 - 21:05:45 CET

This archive was generated by hypermail 2.4.0 : Wed Dec 04 2024 - 21:06:21 CET