Re: FreeBSD fusefs-kmod shutdown problem workaround - FreeBSD

This is a discussion on Re: FreeBSD fusefs-kmod shutdown problem workaround - FreeBSD ; Anish Mistry wrote: > On Sunday 22 June 2008, Dominic Fandrey wrote: >> I know these are desperate mesures, but the problem that fusefs >> doesn't write everything back to the disk before a shutdown is >> completed remains, because ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: FreeBSD fusefs-kmod shutdown problem workaround

  1. Re: FreeBSD fusefs-kmod shutdown problem workaround

    Anish Mistry wrote:
    > On Sunday 22 June 2008, Dominic Fandrey wrote:
    >> I know these are desperate mesures, but the problem that fusefs
    >> doesn't write everything back to the disk before a shutdown is
    >> completed remains, because the rc script is often shot down by
    >> the shutdown watchdog.
    >>
    >> Hence I have extended my workaround to force stop the watchdog
    >> until everything is written to the media.
    >>
    >> Regards,
    >> Dominic
    >>
    >> diff -Pur ports/sysutils/fusefs-kmod.orig/files/fusefs.in
    >> ports/sysutils/fusefs-kmod/files/fusefs.in ---
    >> ports/sysutils/fusefs-kmod.orig/files/fusefs.in 2008-06-22
    >> 21:35:27.000000000 +0200 +++
    >> ports/sysutils/fusefs-kmod/files/fusefs.in 2008-06-22
    >> 21:44:34.000000000 +0200 @@ -50,9 +50,18 @@
    >> ;;
    >> esac
    >> done
    >> +
    >> + # This is an evil yet necessary hack to give fuse the time to
    >> + # write all data to the media before the system is shut down.
    >> + if [ -n "$rcshutdown_timeout" -a -n "$_rcshutdown_watchdog" ]; then
    >> + /bin/kill -STOP "$_rcshutdown_watchdog"
    >> + fi
    >> until kldunload $kmod; do
    >> /bin/sleep 0.25
    >> done
    >> + if [ -n "$rcshutdown_timeout" -a -n "$_rcshutdown_watchdog" ]; then
    >> + /bin/kill -CONT "$_rcshutdown_watchdog"
    >> + fi
    >> }
    >> load_rc_config $name

    > Please open a PR, this is out of my comfort zone by doing "evil" stuff
    > during shutdown. It would probably be helpful to bring up this on
    > hackers/current by showing your patch. Hopefully we can get some
    > attention and get the necessary changes in the base/kernel to do
    > this "right". It does look like there is a solution in Csaba's
    > development version.
    > Did you take a look at Csaba's message on hackers at the beginning of
    > January?
    >


    Thanks for the pointer. Unfortunately it seems that Csaba's patch only
    allows you to stall shutdown for 10 seconds. After heavy writing
    more than a minute can be necessary to prevent data loss.

    I have created a problem report: ports/124901
    http://www.freebsd.org/cgi/query-pr.cgi?pr=124901

    I hope this will make it. To me data loss and file system corruption
    are the worst case scenario and to me it's worth stalling shutdown
    for as long as it takes to write the data.

    Regards,
    Dominic
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/lis...reebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  2. Re: FreeBSD fusefs-kmod shutdown problem workaround

    Kostik Belousov wrote:
    > On Mon, Jun 23, 2008 at 02:41:29PM -0400, Zaphod Beeblebrox wrote:
    >> On Mon, Jun 23, 2008 at 2:41 AM, Dominic Fandrey
    >> wrote:
    >>
    >>
    >>> Thanks for the pointer. Unfortunately it seems that Csaba's patch only
    >>> allows you to stall shutdown for 10 seconds. After heavy writing
    >>> more than a minute can be necessary to prevent data loss.
    >>>
    >>> I have created a problem report: ports/124901
    >>> http://www.freebsd.org/cgi/query-pr.cgi?pr=124901
    >>>
    >>> I hope this will make it. To me data loss and file system corruption
    >>> are the worst case scenario and to me it's worth stalling shutdown
    >>> for as long as it takes to write the data.
    >>>

    >> The shutdown watchdog timer is something I've had to adjust many times for
    >> many different ports. Given this;
    >>
    >> I propose we have (at least) a new rcorder script variable. Something like
    >> "SHUTTIME" encoding the expected number of seconds required for the daemon
    >> to shutdown in the worst case.
    >>
    >> Ideally, you'd want an overall watchdog and a per-script watchdog (so that
    >> you're not waiting the sum of all these times in most cases).

    >
    > We already have rcshutdown_timeout, see the rc.conf(5) and description
    > of the sysctl kern.init_shutdown_timeout.


    He knows that. He just wants something more fine-grained. And
    rcshutdown_timeout has to be set by the user.

    Following Zaphod's suggestion I'd like to have a more generous watchdog default
    (maybe 3 minutes) and a per script watchdog that defaults to something around
    30 seconds, but can be changed in the rc script.

    I'll give that a try tonight.
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/lis...reebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


+ Reply to Thread