kisslinux / init

KISS Linux - Init Framework
https://kisslinux.github.io
MIT License
90 stars 27 forks source link

rc.shutdown: fix premature unmounting of pseudo-filesystems #23

Closed noocsharp closed 3 years ago

noocsharp commented 3 years ago

When passing the -t flag to umount, the "no" prefix applies to the whole list of fs types, not just the one that it prefixes (see umount man page or libbb/match_fstype.c in busybox source code). Currently, umount tries to ignore "noproc", "nodevtmpfs" and "notmpfs", due to the "no" prefix on "sysfs". They obviously do not match "proc", "devtmpfs" and "tmpfs", meaning these filesystems get unintentionally and prematurely unmounted. This leads to errors about not being able to read /proc/mounts on shutdown.

This fixes the issue by correctly prefixing just the whole list, rather than each filesystem type.