Skip to content

Commit

Permalink
overlay-setup: Run before several /var using units
Browse files Browse the repository at this point in the history
Systemd ships several units that require access to /var but are not
ordered after local-fs.target. It would be better if they did, but
that's not the case today. Systemd doesn't expect the kind of mount
post-processing that's done here, so order the unit before all of those
units.

https://phabricator.endlessm.com/T35323
  • Loading branch information
dbnicholson committed Apr 18, 2024
1 parent 0e1e0ae commit 0cddd9e
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion eos-live-boot-overlayfs-setup.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,30 @@
Description=Endless live boot overlayfs setup
DefaultDependencies=no
After=ostree-remount.service var.mount
Before=local-fs.target systemd-random-seed.service
Before=local-fs.target
ConditionKernelCommandLine=endless.live_boot

# Systemd ships several units that require access to /var but are not ordered
# after local-fs.target. It would be better if they did, but that's not the
# case today. Systemd doesn't expect the kind of mount post-processing that's
# done here.
#
# You can find these with the following command:
#
# grep -rl -e StateDirectory -e CacheDirectory -e LogsDirectory -e var.mount \
# -e 'RequiresMountsFor=.*/var' /usr/lib/systemd/system \
# | xargs grep -l -e DefaultDependencies | sort
Before[email protected]
Before[email protected]
Before=systemd-journal-flush.service
Before=systemd-pstore.service
Before=systemd-random-seed.service
Before=systemd-rfkill.service
Before=systemd-rfkill.socket
Before=systemd-timesyncd.service
Before=systemd-update-utmp-runlevel.service
Before=systemd-update-utmp.service

[Service]
Type=oneshot
ExecStart=/usr/sbin/eos-live-boot-overlayfs-setup
Expand Down

0 comments on commit 0cddd9e

Please sign in to comment.