]> git.ipfire.org Git - thirdparty/systemd.git/commit
binfmt: also unregister binfmt entries from unit
authorLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 14:36:45 +0000 (16:36 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 15:14:45 +0000 (17:14 +0200)
commit846acb6798a63f35162f58e1146d1a1f40849e86
tree4a12d9a7dad0e240dff1300f1a0dc8e03d7beaff
parentf3670df13e144c2f81bf6f9a0bea581e6d555bdd
binfmt: also unregister binfmt entries from unit

We unregister binfmt_misc twice during shutdown with this change:

1. A previous commit added support for doing that in the final shutdown
   phase, i.e. when we do the aggressive umount loop. This is the robust
   thing to do, in case the earlier ("clean") shutdown phase didn't work
   for some reason.

2. This commit adds support for doing that when systemd-binfmt.service
   is stopped. This is a good idea so that people can order mounts
   before the service if they want to register binaries from such
   mounts, as in that case we'll undo the registration on shutdown
   again, before unmounting those mounts.

And all that, just because of that weird "F" flag the kernel introduced
that can pin files...

Fixes: #14981
src/binfmt/binfmt.c
units/systemd-binfmt.service.in