Date: Tue, 28 Jul 2009 21:34:47 +0300 From: Artis Caune <artis.caune@gmail.com> To: Alexander Petrovsky <askjuise@gmail.com> Cc: freebsd-jail@freebsd.org Subject: Re: Jails on ZFS Message-ID: <9e20d71e0907281134j41f767ddrf3dc2e3154d724a4@mail.gmail.com> In-Reply-To: <2ec071a80907280748p336f6356p78d2debcfd8cd18b@mail.gmail.com> References: <9e20d71e0907280716m3968f42pe7aeed2b0286302c@mail.gmail.com> <2ec071a80907280748p336f6356p78d2debcfd8cd18b@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
2009/7/28 Alexander Petrovsky <askjuise@gmail.com>: > Hi, it is may be good idea. But, I can't understand your code, why you do= - > =C2=A0umount ${_dir} >/dev/null 2>&1 || { sleep 2; umount ${_dir} >/dev/n= ull 2>&1 > || umount -f ${_dir} >/dev/null 2>&1; } > > instead > =C2=A0umount ${_dir} >/dev/null 2>&1 || umount -f ${_dir} >/dev/null 2>&1 > > ? Because when jail is shuting down, file system is still busy. I think this is because of syslogd, which has no rc.d shutdown keyword, and so it's been killed. Immediately after killing all jail processes, file systems are unmounted. It helps sleeping 1, 2 seconds and then trying to unmount it, and if fs is still busy, force unmount it. Maybe this is better: --- /etc/rc.d/jail 2009-07-22 23:29:29.000000000 +0300 +++ /etc/rc.d/jail 2009-07-28 21:23:30.436217867 +0300 @@ -270,7 +270,7 @@ _dir=3D$1 if is_current_mountpoint ${_dir}; then - umount -f ${_dir} >/dev/null 2>&1 + umount ${_dir} >/dev/null 2>&1 || umount -f ${_dir} >/dev/null 2>&1 else debug "Nothing mounted on ${_dir} - not unmounting" fi @@ -700,6 +700,7 @@ killall -j ${_jail_id} -TERM > /dev/null 2>&1 sleep 1 killall -j ${_jail_id} -KILL > /dev/null 2>&1 + sleep 2 jail_umount_fs echo -n " $_hostname" --=20 Artis Caune Everything should be made as simple as possible, but not simpler.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9e20d71e0907281134j41f767ddrf3dc2e3154d724a4>