Skip to content

Commit

Permalink
systemd: only unmount FUSE for systemd pre-247
Browse files Browse the repository at this point in the history
  • Loading branch information
paradigm committed Jan 3, 2022
1 parent 4663bce commit d37ad04
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description=Shutdown Bedrock Linux FUSE filesystems.
[Service]
RemainAfterExit=yes
ExecStart=-/bedrock/libexec/busybox true
ExecStop=-/bedrock/libexec/busybox sh -c '/bedrock/libexec/busybox umount -l /etc /bedrock/strata/*/etc /bedrock/cross /bedrock/strata/*/bedrock/cross'
ExecStop=-/bedrock/libexec/busybox sh /bedrock/share/systemd/stop-fuse-filesystems.sh

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions src/slash-bedrock/share/systemd/stop-fuse-filesystems.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bedrock/libexec/busybox sh
#
# Some systemd version circa systemd 237 in 2018 was found to have difficulty
# unmounting FUSE filesystems which resulted in shutdown delays. Bedrock
# worked around this with a unit file that assists in unmounting Bedrock's FUSE
# filesytems.
#
# Some systemd version circa systemd 247 in 2020 was found to have improved the
# FUSE filesystem handling, but changed something which resulted in Bedrock's
# FUSE assistance causing a shutdown delay.
#
# Thus, we only want to assist unmounting for pre-247 systemd versions.

if command -v systemctl >/dev/null 2>&1 && [ "$(systemctl --version | awk '{print$2;exit}')" -lt 247 ]; then
umount -l /etc /bedrock/strata/*/etc /bedrock/cross /bedrock/strata/*/bedrock/cross
fi

0 comments on commit d37ad04

Please sign in to comment.