diff --git a/man/systemd.offline-updates.xml b/man/systemd.offline-updates.xml index 258d446784..c11004c882 100644 --- a/man/systemd.offline-updates.xml +++ b/man/systemd.offline-updates.xml @@ -136,6 +136,7 @@ The update service should declare DefaultDependencies=false, Requires=sysinit.target, After=sysinit.target, + After=system-update-pre.target and explicitly pull in any other services it requires. diff --git a/units/meson.build b/units/meson.build index 77d52c1083..e4ac6ced64 100644 --- a/units/meson.build +++ b/units/meson.build @@ -77,6 +77,7 @@ units = [ ['sysinit.target', ''], ['syslog.socket', ''], ['system-update.target', ''], + ['system-update-pre.target', ''], ['system-update-cleanup.service', ''], ['systemd-ask-password-console.path', '', 'sysinit.target.wants/'], diff --git a/units/system-update-pre.target b/units/system-update-pre.target new file mode 100644 index 0000000000..dbd9ad92ec --- /dev/null +++ b/units/system-update-pre.target @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Offline System Update (Pre) +Documentation=man:systemd.offline-updates(7) +Documentation=man:systemd.special(7) man:systemd-system-update-generator(8) +RefuseManualStart=yes +After=sysinit.target +Before=system-update.target diff --git a/units/system-update.target b/units/system-update.target index c46bfe754a..b52a494892 100644 --- a/units/system-update.target +++ b/units/system-update.target @@ -14,4 +14,5 @@ Documentation=man:systemd.special(7) man:systemd-system-update-generator(8) Requires=sysinit.target After=sysinit.target AllowIsolate=yes +Wants=system-update-pre.target Wants=system-update-cleanup.service