Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Mar 2011 13:42:09 -0700
From:      Freddie Cash <fjwcash@gmail.com>
To:        Thomas Johnson <tom@claimlynx.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: HAST + ZFS causes system to shutdown uncleanly?
Message-ID:  <AANLkTimStVjbmiAZdR8-wbQyj8e0Rorjb=Vz-WxbYiCq@mail.gmail.com>
In-Reply-To: <AANLkTikh=svOS-HYPop5ieVxf3cuUUc8V=h=5xXt6-A5@mail.gmail.com>
References:  <AANLkTim5Brtn6nn=HJzB_eQGBg-Va4fXc5wSdvs5Y0kQ@mail.gmail.com> <AANLkTikh=svOS-HYPop5ieVxf3cuUUc8V=h=5xXt6-A5@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 17, 2011 at 1:36 PM, Freddie Cash <fjwcash@gmail.com> wrote:
> On Thu, Mar 17, 2011 at 12:32 PM, Thomas Johnson <tom@claimlynx.com> wrote:
>> Has anyone else noticed issues halting a system that is configured with a
>> ZFS filesystem on a HAST device? I am using HAST to replicate a ZFS
>> filesystem between two ESXi virtual machines (trying to emulate our
>> production systems in a test environment) and I've noticed that the system
>> doesn't seem to shutdown completely in this arrangement (hangs after ""
>> message). I did some poking around and learned that if I unmount my zfs
>> filesystems before shutdown, the shutdown finishes cleanly. Muddling my way
>> through the rc scripts, it looks like hastd is killed fairly early on in the
>> shutdown sequence. Presumably this is preventing the system from
>> syncing/unmounting the ZFS mounts, causing the shutdown to hang.
>>
>> Does this seem plausible? If so, any ideas on fix, besides making sure I
>> 'zfs unmount -a' before shutdown?
>
> Does it work if you manually add "hastd" to the REQUIRE: line in /etc/rc.d/zfs?
>
> Of course, that only works if you are starting zfs automatically via
> /etc/rc.conf, and not letting CARP/devd or something else manage the
> pool import process.

Thinking about it, perhaps we need a hook into the top of the
hastd_stop_precmd() function in /etc/rc.d/hastd?

Something like "hastd_stop_args" in /etc/rc.conf where we can put
commands to be run before hastd is stopped?

Then it would be as simple as putting hastd_stop_args="zfs unmount -a"
into /etc/rc.conf.

Or something along those lines, so that we stop any consumers of the
/dev/hast/* devices before we stop the hast daemon.

-- 
Freddie Cash
fjwcash@gmail.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimStVjbmiAZdR8-wbQyj8e0Rorjb=Vz-WxbYiCq>