Skip to content

Commit d37ad04

Browse files
committed
systemd: only unmount FUSE for systemd pre-247
1 parent 4663bce commit d37ad04

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/slash-bedrock/share/systemd/bedrock-stop-fuse-filesystems.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Description=Shutdown Bedrock Linux FUSE filesystems.
77
[Service]
88
RemainAfterExit=yes
99
ExecStart=-/bedrock/libexec/busybox true
10-
ExecStop=-/bedrock/libexec/busybox sh -c '/bedrock/libexec/busybox umount -l /etc /bedrock/strata/*/etc /bedrock/cross /bedrock/strata/*/bedrock/cross'
10+
ExecStop=-/bedrock/libexec/busybox sh /bedrock/share/systemd/stop-fuse-filesystems.sh
1111

1212
[Install]
1313
WantedBy=multi-user.target
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bedrock/libexec/busybox sh
2+
#
3+
# Some systemd version circa systemd 237 in 2018 was found to have difficulty
4+
# unmounting FUSE filesystems which resulted in shutdown delays. Bedrock
5+
# worked around this with a unit file that assists in unmounting Bedrock's FUSE
6+
# filesytems.
7+
#
8+
# Some systemd version circa systemd 247 in 2020 was found to have improved the
9+
# FUSE filesystem handling, but changed something which resulted in Bedrock's
10+
# FUSE assistance causing a shutdown delay.
11+
#
12+
# Thus, we only want to assist unmounting for pre-247 systemd versions.
13+
14+
if command -v systemctl >/dev/null 2>&1 && [ "$(systemctl --version | awk '{print$2;exit}')" -lt 247 ]; then
15+
umount -l /etc /bedrock/strata/*/etc /bedrock/cross /bedrock/strata/*/bedrock/cross
16+
fi

0 commit comments

Comments
 (0)