Bug 147444 - [rc.d] [patch] /etc/rc.d/zfs stop not called on reboot & modules cause system hang
Summary: [rc.d] [patch] /etc/rc.d/zfs stop not called on reboot & modules cause system...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 7.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-03 19:10 UTC by Mykah
Modified: 2017-12-31 22:34 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mykah 2010-06-03 19:10:01 UTC
Hardware:
CPU: Quad-Core Xeon L3426
MEM: 16G
CONTROLLER: 3ware 9750-8i (all disks as single-disk units exported
individually, except for the OS which is a HW Raid1 = /dev/da0)

ZFS: 10 x 2TB raidz2 currently running defaults. (2TB Hitachi SATA)

ZFS is configured to start @ boot via 'zfs_enable="YES"' in the /etc/rc.conf.

Creation Commands:
# zpool create storage01 raidz2 da1 da2 da3 da4 da5 da6 da7 da8 da9 da10 
# zpool add storage01 spare da11 da12 
# zfs create storage01/tachyon 
# zfs create storage01/iron 
# zfs create storage01/boson 
# zfs create storage01/hydro

Fix: 

Note: You can get a clean 'shutdown -r now' after these edits. Unfortunately,
'reboot' still does not function and hangs the system. I believe 'reboot'
does not trigger rc.shutdown and hence does not fire off the 'rcorder -k
shutdown /etc/rc.d/*' that a 'shutdown' would.

Edit /etc/rc.d/zfs as follows:

ADD below '#REQUIRE: mountcritlocal':
# KEYWORD shutdown

ADD @ bottom of zfs_stop_main() subroutine/function:
kldunload zfs.ko  opensolaris.ko
sleep 5
kldunload zfs.ko opensolaris.ko
sleep 5
How-To-Repeat: Create a pool and then attempt to:
# reboot
or
# shutdown -r now

Result:
Waiting (max 60 seconds) for system process `vnlru' to stop...done.
Waiting (max 60 seconds) for system process `bufdaemon' to stop...done.
Waiting (max 60 seconds) for system process `syncer' to stop...done.
Syncing disks, vnodes remaining... (etc, etc).. done
All buffers synced.
zfs_umount:1005[0] Force unmount is experimental - report any problems.
zfs_umount:1005[0] Force unmount is experimental - report any problems.
zfs_umount:1005[0] Force unmount is experimental - report any problems.
zfs_umount:1005[0] Force unmount is experimental - report any problems.
zfs_umount:1005[0] Force unmount is experimental - report any problems.
Uptime: <TIME>
--- HANGS ----
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2010-06-04 02:11:01 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:57 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped