Re: [PATCH v2 3/6] maintenance: simplify systemctl calls
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Mar 22, 2024, 23:09 UTC
- Message-ID
- <CAPig+cTeXMw8pTS9on_CSJraPDYKSLaFd82LEtWjFgOBzH4=yg@mail.gmail.com>
- In-Reply-To
- <20240322221327.12204-4-mg@max.gautier.name>
On Fri, Mar 22, 2024 at 6:13 PM Max Gautier <mg@max.gautier.name> wrote:
> The systemctl invocation to enable or disable the git maintenance timers > is needlessly complicated: > - systemctl does not mind at all enabling already enabled units, nor > disabling already disabled units.
Has systemctl behavior changed...
Show 13 quoted lines
> Use only one systemctl invocation per `git maintenance start/stop`. > Transparently pass its status and output. > Add the --force option to override conflicting symlinks to previous > instances of our units files which lived in $XDG_CONFIG_HOME. > > Signed-off-by: Max Gautier <mg@max.gautier.name> > --- > diff --git a/builtin/gc.c b/builtin/gc.c > @@ -2303,70 +2303,35 @@ static int is_systemd_timer_available(void) > - * Disabling the systemd unit while it is already disabled makes > - * systemctl print an error. > - * Let's ignore it since it means we already are in the expected state: > - * the unit is disabled.
... since this and...
> - * Disabling an already disabled systemd unit makes > - * systemctl fail. > - * Let's ignore this failure.
... this were written?
If so, do we still need to worry about older systems in which systemctl prints errors and/or fails outright?