Skip to content

Commit

Permalink
filesystem: document _pre_shutdown and link to systemd-shutdown impl
Browse files Browse the repository at this point in the history
We decided to revert the use of systemd-shutdown for exporting zpools
because it didn't address the issue we were trying to solve. However,
dropping scripts for systemd-shutdown is an interesting implementation
from an architecture standpoint, because it can be executed even if
Subiquity does not cleanly exit.

Let's document the _pre_shutdown function and link to the original
systemd-shutdown implementation that we came up with for exporting
zpools earlier.

Signed-off-by: Olivier Gayot <[email protected]>
(cherry picked from commit f36c828)
  • Loading branch information
ogayot committed Sep 9, 2024
1 parent f20135f commit f9b3400
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions subiquity/server/controllers/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,19 @@ def make_autoinstall(self):
return r

async def _pre_shutdown(self):
"""This function is executed just before rebooting and after copying
logs to the target. This means bugs reports are unlikely to include
execution logs from this function and therefore diagnosing issues is a
challenge. Let's try to keep it as simple as possible.
Another approach to execute commands before reboot is to place scripts in
/usr/lib/systemd/system-shutdown and lean on systemd-shutdown(8) to
execute them after unmounting most file-systems.
See this PR for an example (the PR was eventually reverted because it
didn't address the issue we tried to solve at the time).
https://github.com/canonical/subiquity/pull/2064
"""
if not self.reset_partition_only:
# /target is mounted only if the installation was actually started.
try:
Expand Down

0 comments on commit f9b3400

Please sign in to comment.