From 4186441bbd912dea9c8a43dfd19dcbea90b4c3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 19 Dec 2019 10:42:14 +0100 Subject: [PATCH 1/3] Revert "cryptsetup: umount encrypted devices before detaching it during shutdown" This reverts commit 362c378291e85df3e00aaad491d1e08233ad127f. This commit introduced an ordering loop: remote-cryptsetup.target was both before and after remote-fs-pre.target. It also globally ordered all cryptsetup volumes before all mounts. Such global ordering is problematic if people have stacked storage. Let's look for a different solution. See https://github.com/systemd/systemd/pull/14378#discussion_r359460109. --- man/bootup.xml | 25 +++++++++---------------- units/local-fs-pre.target | 1 - units/remote-fs-pre.target | 1 - 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/man/bootup.xml b/man/bootup.xml index 55b3eb8a332..d3715234000 100644 --- a/man/bootup.xml +++ b/man/bootup.xml @@ -92,24 +92,17 @@ -(various cryptsetup - devices...) +local-fs-pre.target | v - cryptsetup.target - | - v - local-fs-pre.target - | - v -(various mounts and (various swap - fsck services...) devices...) (various low-level (various low-level - | | services: udevd, API VFS mounts: - v v tmpfiles, random mqueue, configfs, - local-fs.target swap.target seed, sysctl, ...) debugfs, ...) - | | | | - \__________________|_________________ _________________|______________________/ - \ / +(various mounts and (various swap (various cryptsetup + fsck services...) devices...) devices...) (various low-level (various low-level + | | | services: udevd, API VFS mounts: + v v v tmpfiles, random mqueue, configfs, + local-fs.target swap.target cryptsetup.target seed, sysctl, ...) debugfs, ...) + | | | | | + \__________________|_________________ | ___________________|____________________/ + \|/ v sysinit.target | diff --git a/units/local-fs-pre.target b/units/local-fs-pre.target index e9a1f188bf3..9aca15b9538 100644 --- a/units/local-fs-pre.target +++ b/units/local-fs-pre.target @@ -11,4 +11,3 @@ Description=Local File Systems (Pre) Documentation=man:systemd.special(7) RefuseManualStart=yes -After=cryptsetup.target diff --git a/units/remote-fs-pre.target b/units/remote-fs-pre.target index b4a68c73dd6..3f22605c8c7 100644 --- a/units/remote-fs-pre.target +++ b/units/remote-fs-pre.target @@ -11,4 +11,3 @@ Description=Remote File Systems (Pre) Documentation=man:systemd.special(7) RefuseManualStart=yes -After=remote-cryptsetup.target From f71502c49fd9fce6328f9364f600578383551dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 18 Dec 2019 10:32:03 +0100 Subject: [PATCH 2/3] man: add remote-*.targets to the bootup sequence I think this makes it easier to see the difference between local and remote mounts. Make the graph a bit narrower while at it. --- man/bootup.xml | 96 ++++++++++++++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/man/bootup.xml b/man/bootup.xml index d3715234000..4641e86e109 100644 --- a/man/bootup.xml +++ b/man/bootup.xml @@ -92,49 +92,59 @@ -local-fs-pre.target - | - v -(various mounts and (various swap (various cryptsetup - fsck services...) devices...) devices...) (various low-level (various low-level - | | | services: udevd, API VFS mounts: - v v v tmpfiles, random mqueue, configfs, - local-fs.target swap.target cryptsetup.target seed, sysctl, ...) debugfs, ...) - | | | | | - \__________________|_________________ | ___________________|____________________/ - \|/ - v - sysinit.target - | - ____________________________________/|\________________________________________ - / | | | \ - | | | | | - v v | v v - (various (various | (various rescue.service - timers...) paths...) | sockets...) | - | | | | v - v v | v rescue.target - timers.target paths.target | sockets.target - | | | | - v \_________________ | ___________________/ - \|/ - v - basic.target - | - ____________________________________/| emergency.service - / | | | - | | | v - v v v emergency.target - display- (various system (various system - manager.service services services) - | required for | - | graphical UIs) v - | | multi-user.target - | | | - \_________________ | _________________/ - \|/ - v - graphical.target + cryptsetup-pre.target + | +(various low-level v + API VFS mounts: (various cryptsetup devices...) + mqueue, configfs, | | + debugfs, ...) v | + | cryptsetup.target | + | (various swap | | remote-fs-pre.target + | devices...) | | | | + | | | | | v + | v local-fs-pre.target | | | (network file systems) + | swap.target | | v v | + | | v | remote-cryptsetup.target | + | | (various low-level (various mounts and | | | + | | services: udevd, fsck services...) | | remote-fs.target + | | tmpfiles, random | | | / + | | seed, sysctl, ...) v | | / + | | | local-fs.target | | / + | | | | | | / + \____|______|_______________ ______|___________/ | / + \ / | / + v | / + sysinit.target | / + | | / + ______________________/|\_____________________ | / + / | | | \ | / + | | | | | | / + v v | v | | / + (various (various | (various | |/ + timers...) paths...) | sockets...) | | + | | | | | | + v v | v | | +timers.target paths.target | sockets.target | | + | | | | v | + v \_______ | _____/ rescue.service | + \|/ | | + v v | + basic.target rescue.target | + | | + ________v____________________ | + / | \ | + | | | | + v v v | + display- (various system (various system | + manager.service services services) | + | required for | | + | graphical UIs) v v + | | multi-user.target +emergency.service | | | + | \_____________ | _____________/ + v \|/ +emergency.target v + graphical.target Target units that are commonly used as boot targets are emphasized. These units are good choices as From 277519db51291c7e11b2120016c39914520f5009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 18 Dec 2019 11:23:30 +0100 Subject: [PATCH 3/3] man: add section about user manager units --- man/bootup.xml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/man/bootup.xml b/man/bootup.xml index 4641e86e109..28f14891d9b 100644 --- a/man/bootup.xml +++ b/man/bootup.xml @@ -160,6 +160,45 @@ emergency.service | | | later in boot. + + User manager startup + + The system manager starts the user@uid.service unit + for each user, which launches a separate unprivileged instance of systemd for each + user — the user manager. Similarly to the system manager, the user manager starts units which are pulled + in by default.target. The following chart is a structural overview of the well-known + user units. For non-graphical sessions, default.target is used. Whenever the user + logs into a graphical session, the login manager will start the + graphical-session.target target that is used to pull in units required for the + grahpical session. A number of targets (shown on the right side) are started when specific hardware is + available to the user. + + + (various (various (various + timers...) paths...) sockets...) (sound devices) + | | | | + v v v v + timers.target paths.target sockets.target sound.target + | | | + \______________ _|_________________/ (bluetooth devices) + \ / | + V v + basic.target bluetooth.target + | + __________/ \_______ (smartcard devices) + / \ | + | | v + | v smartcard.target + v graphical-session-pre.target + (various user services) | (printers) + | v | + | (services for the graphical sesion) v + | | printer.target + v v + default.target graphical-session.target + + + Bootup in the Initial RAM Disk (initrd) The initial RAM disk implementation (initrd) can be set up