[systemd-devel] Running a service *just* before unmounting filesystems

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Jun 13 15:05:56 UTC 2018


On Wed, Jun 13, 2018 at 04:55:27PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 12-06-18 19:11, Lennart Poettering wrote:
> >On Di, 12.06.18 11:33, Hans de Goede (hdegoede at redhat.com) wrote:
> >>AFAIK the service actually doing the updates is supposed to call
> >>systemctl reboot --force when it is done, so any targets after
> >>system-update.target won't get started ?
> >
> >True, the service in question could split the reboot call of course,
> >if it wanted, so that you can plug things in between.
> 
> Since in this case we want to increment a boot_indeterminate counter
> to indicate the last boot was not a normal boot, so no clear
> success status is available I'm fine with the service doing the
> increment before the updates run.
> 
> So I was thinking about adding a system-update-pre.target
> and then in system-update.target add:
> 
> Wants=system-update-pre.target
> After=system-update-pre.target
Yep, that sounds reasonable.

> I would rather not modify the existing offline-updates
> services because there are 3 of them and I believe it
> would be better to do this in a single place.
Yes, let's better avoid that. If those services are
to be modified, I'd rather work on converting them to start
a new target like system-update-post.target, and move the reboot
there, so that they don't have to be modified again after that.

Zbyszek


More information about the systemd-devel mailing list