Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Oct 2015 15:17:24 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 187081] swapoff runs too early during shutdown
Message-ID:  <bug-187081-8-pgLUqqs1Nt@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-187081-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-187081-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=187081

c.kworr@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |c.kworr@gmail.com

--- Comment #1 from c.kworr@gmail.com ---
Created attachment 161855
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=161855&action=edit
fix "swaplate" to deal only with "late" swap devices

Hi. I like to join this heated conversation. :)

It seems to me you are bitten with /etc/rc.d/swaplate which should remove swap
partitions that are not directly available. Yet due to bug in the
swapon/swapoff logic it rather removes all swap partitions. I'm bored with this
too as on my machine swap is used constantly and when rebooting for some weird
reason I need to wait while the system gets all my sleepy daemons from swap
back to the memory instead of just stopping them.

The key problem is "-a" and "-L" options to swapon/swapoff as they give only
two choices:

1. Single "-a" selects only not "late" "auto" devices (the ones without
"noauto" and "late") from /etc/fstab.
2. Both options ("-aL") select whole range of "auto" devices (only skipping
"noauto" ones) from /etc/fstab.

This two choices doesn't give us a possibility to turn off only "late" devices,
that can really be dependent on some daemons with higher priorities so they MAY
fail further down "shutdown" sequence and as such they SHOULD be turned off
early during "shutdown".

The fix I propose actually breaks compatibility but I don't think this would be
an issue as:

 * there's not that much consumers of mentioned options in the scripts;
 * the fix brings clarity and usability.

In this fix:

 * single "-a" still select only not "late" "auto" devices;
 * option "-L" inverts "-a" meaning and selects only "late" "auto" devices;
 * documentation and starting script are fixed.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-187081-8-pgLUqqs1Nt>