aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2026-05-23 12:30:44 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2026-05-23 12:30:44 +0000
commit7329cd1b23ba51c9ea8f526dbd491b8cd9d5b822 (patch)
tree6f4a757704252308d42662f1a066fd5490a213e5 /src
parent94830d74874b9192faeeebda281029250dd825e7 (diff)
downloads6-linux-init-7329cd1b23ba51c9ea8f526dbd491b8cd9d5b822.tar.gz
Prepare for 1.2.0.2; attempt ro remount if umount fails
Diffstat (limited to 'src')
-rw-r--r--src/misc/s6-linux-init-umountall.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/misc/s6-linux-init-umountall.c b/src/misc/s6-linux-init-umountall.c
index d4320ad..e7a2f53 100644
--- a/src/misc/s6-linux-init-umountall.c
+++ b/src/misc/s6-linux-init-umountall.c
@@ -55,8 +55,19 @@ int main (int argc, char const *const *argv)
while (line--)
if (umount(sa.s + mountpoints[line]) == -1)
{
- e++ ;
- strerr_warnwu2sys("umount ", sa.s + mountpoints[line]) ;
+ if (errno == EBUSY)
+ {
+ if (mount(0, sa.s + mountpoints[line], 0, MS_REMOUNT | MS_RDONLY, 0) == -1)
+ {
+ e++ ;
+ strerr_warnwusys("read-only remount ", sa.s + mountpoints[line]) ;
+ }
+ }
+ else
+ {
+ e++ ;
+ strerr_warnwu2sys("umount ", sa.s + mountpoints[line]) ;
+ }
}
stralloc_free(&sa) ;
return e ;