diff mbox series

base-files: force /overlay to be remounted ro during shutdown.

Message ID 20231010200556.1532915-1-apanovic@infiniphy.com
State New
Headers show
Series base-files: force /overlay to be remounted ro during shutdown. | expand

Commit Message

Alec Panoviciu Oct. 10, 2023, 8:05 p.m. UTC
When using overlayfs the '/bin/umount -a -d -r' command doesn't
actually unmount the upper fs as it's still referenced by the
overlay. This workaround makes the upper fs appear busy so it
at least gets remounted readonly.

Signed-off-by: Alec Panoviciu <apanovic@infiniphy.com>
---
 package/base-files/files/etc/init.d/umount | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/package/base-files/files/etc/init.d/umount b/package/base-files/files/etc/init.d/umount
index b764ae1..1776adc 100755
--- a/package/base-files/files/etc/init.d/umount
+++ b/package/base-files/files/etc/init.d/umount
@@ -9,5 +9,6 @@  restart() {
 
 stop() {
 	sync
-	/bin/umount -a -d -r
+	# force /overlay to be remounted ro if present
+	(cd /overlay ; /bin/umount -a -d -r )
 }