On Fri, Jun 2, 2023, 15:30 James Addison <j...@jp-hosting.net> wrote:

> On Fri, 2 Jun 2023 at 15:24, James Addison <j...@jp-hosting.net> wrote:
> >
> > > > Also, arguing against my own revert-patch: I think it could be said
> > > > that multi-user is the "better" target to use here, because the
> > > > default could be "graphical" or some later-reached system state
> > > > whereas this is a relatively low-level (if small) system cleanup
> > > > service.
> > >
> > > Right, that's I believe the point of bug #991349; it's possible that
> > > the system adminsitrator might manually set default.target to point to
> > > graphical.target, per [1].  And since multi-user.target is a subset of
> > > graphical.target, it makes sense to make the Wanted-by to be
> > > multi-user.target.
> > >
> > > [1] https://www.baeldung.com/linux/systemd-target-multi-user
> >
> > I guess so.  However, now that I read it, the manual for
> > systemd.special[1] does indicate that the target it will load at boot
> > is default.target -- whatever it's configured to (usually multi-user
> > or graphical).
> >
> > In other words: default.target should be a subset of all of
> > multi-user.target, graphical.target, and whatever else a system
> > administrator might configure as the boot target state.
>
> Eh, poor phrasing there: default.target isn't a _subset_ of all those
> targets, but for any given systemd-enabled boot environment,
> default.target should be guaranteed (as far as systemd lives up to the
> guarantees it aims to provide) to be on the service startup path
> between systemd loading as init and systemd reaching the desired boot
> state.
>
> > > In this particular case, since we *always* want it to be
> > > default.target, since the whole *point* is to clean up after a failed
> > > e2scrub, it seems really unlikely to me that the system administrator
> > > would change this.  So this is one where it's probably fair for the
> > > postinstall script to just fix the wanted-by link **always** if the
> > > the systemd unit file says Wanted-by: default.target, and the symlink
> > > is inconsistent with it.
> >
> > What do you mean by "fix the link" in this context?
> >
> > [1] -
> https://manpages.debian.org/bullseye/systemd/systemd.special.7.en.html


After further thought here: if the change from #991349 to use
multi-user.target means slightly earlier invocation of the service when
working towards graphical.target, but _also_ means that the service won't
be invoked _at all_ on some systemd-enabled systems (whenever
default.target is configured to a state that doesn't visit
multi-user.target)... then I think rolling back to default.target would be
better.

Reply via email to