On Wed, 25 Feb 2026 09:30:47 +0000
Andrew Bower <[email protected]> wrote:
> >
> > I'm happy that you closed, I would have wontfixed otherwise because
> > there is no easy way to check if service is running or not -
> > ideally we should restart only if is 'foo' is up, regardless of the
> > wanted status - but there is no easy way to do that - 'sv check'
> > test that foo is in the wanted status, it can be 'down' and I don't
> > want to grep 'sv s foo' in the upgrade loop.
> > But if we get support upstream then I would be happy to fix
> > this (I think we need something like 'sv check up foo' --> check
> > that foo is up, regardless of the 'wanted' status)
>
> Doesn't that mean undoing your recent change that did the opposite? I
> must admit I was never 100% confident about that! What will be the
> difference with 'status' - a wait loop calling the check script?
[did you mean check? status doesn't loop it just prints the current
status and the wanted status if they are different]
If you mean quilt patches that I added in 2.2.0-4 ('devground') they
are no longer there now (2.3.0-1) because upstream provided a different
patch for the same issue. But in fact, right now with 2.3.0-1
# sv s cron
run: cron: (pid 14247) 422s
# sv check cron
ok: run: cron: (pid 14247) 441s
# echo $?
0
and then
# sv d cron
# sv s cron
down: cron: 2s, normally up
# sv check cron
ok: down: cron: 49s, normally up
# echo $?
0
so the only way I can think is something like
sv s foo | grep 'ok: down:' --> then skip the upgrade action
but I'm not sure it's always accurate (and it's a grep call for each
service in a loop, which I would like to avoid if possible..)
>
> > that said, may I ask why you use a down file instead of just
> > disabling the service?
>
> Currently these are standalone service directories but when I first
> created them they were instances of a template involving symlink to
> run file in template directory. I suppose it seemed less fragile to
> mark down than use my version of update-service that handled the
> templating. This is moot now because I removed all that magic.
>
> I suppose the documentation needs to make it clear to the user what
> the use case is for 'down' files, if it doesn't already.