msimerson / Mail-Toaster-6

Mail Toaster 6
https://github.com/msimerson/Mail-Toaster-6/wiki
BSD 3-Clause "New" or "Revised" License
46 stars 16 forks source link

cannot unmount '/jails/stage': Device busy #445

Closed zenny closed 4 years ago

zenny commented 4 years ago

Hi,

Is this a normal behavior every time a jail is created that delays deployment of jail as seen in the log below? I didn't see so in the log you posted!

...
   ***   testing Haraka   ***

checking for port 25 listener in staged jail
        checking port 25
Success! Port 25 is listening in staging jail

   ***   promoting jail haraka   ***
jail -r stage
zfs rename tank/jails/stage tank/jails/haraka.ready
waiting for ZFS filesystem to quiet (1)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (3)
waiting for ZFS filesystem to quiet (5)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (6)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (7)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (8)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (9)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (10)
cannot unmount '/jails/stage': Device busy
trying to force rename
waiting for ZFS filesystem to quiet (11)
service jail stop haraka
Stopping jails:.
jail -r haraka

   ***   tank/data/haraka filesystem exists   ***

zfs rename tank/jails/haraka.ready tank/jails/haraka
...

Same with every jail (haproxy in this case):

...
   ***   testing haproxy   ***

it worked

   ***   promoting jail haproxy   ***
jail -r stage
cannot unmount '/jails/stage': Device busy
cannot unmount '/jails/stage': Device busy
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (5)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (6)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (7)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (8)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (9)
cannot unmount '/jails/stage': Device busy
waiting for ZFS filesystem to quiet (10)
cannot unmount '/jails/stage': Device busy
trying to force rename
waiting for ZFS filesystem to quiet (11)
service jail stop haproxy
Stopping jails:.
jail -r haproxy
...

Cheers and stay safe /z

msimerson commented 4 years ago

short answer: it's normal.

longer answer: ZFS doesn't (well, didn't last I checked) have a technique for forcing it to flush the cached FS data to disk. I could just force rename the volumes immediately. That would be safe 98% of the time. I felt better about giving the FS layer a chance to unlock without forcing it, but it never does succeed. It might be time to change the default. I've really been hoping that something like a 'zfs flush ...' would appear.