It seems /etc/init.d/alsasound could use a check to see if alsa modules are even loaded before attempting to unload. I regularly compile in my alsa drivers/modules into my kernels. Not sure I have ever had a modules for alsa stuff. It doesn't seem to be a problem on my x86 workstations. But on my amd64 laptop, the machine regularly freezes as alsa attempts to unload modules. So something there is hanging during unload. I assume it's because I do not have the modules loaded, they are compiled into the kernel.
I'm experiencing a similar behaviour here, but it's related to remote NFS mounts. If I declare an NFS mount in my /etc/fstab, but the remote server is down at boot, the nfsmount rc-script ends with a "cannot mount" error. But then at shutdown, my laptop hangs during alsasound rc-script's fuser use. If I remove the NFS entry in /etc/fstab, the laptop doesn't hang and shutdown properly. Dunno how it's related...
Yes this is nfs doing this and not alsa. Totally my bad. Seems the network is shut down before nfs mounts are unmounted :( Which then causes really long timeouts or hanging when the nfs mounts are umounted. Changing summary. Pretty sure this is /etc/init.d/nfs, but might be /etc/init.d/netmount. Really the problem is with order, network shutdown should be after nfs/netmounts are unmounted.
AFAIK: nfsmount can mount some shares but still fail to finish successfully. netmount OTH will never fail to start, thus ensuring that network filesystems are unmounted before net goes down. (Running net-fs/nfs-utils-1.1.0 and sys-apps/baselayout-1.12.10-r4 here) Might this be the case here (netmount is not in the runlevel, but nfsmount is)?
Currently on my laptop I am not starting nfsmount or netmount. I mount the nfs partitions via entries in my /etc/fstab. I guess if I use one or the other it will unmount shares before shutting down network. Instead I think it might be happening when other fs are being unmounted.
so what exactly is the trouble ? usage of the init.d nfs script is completely unrelated to usage of nfs mounts nfs init.d script is for nfs servers and doesnt actually mount anything the nfsmount init.d script is for nfs clients and handles mounting/unmounting of nfs the netmount init.d script usually doesnt handle nfs mounting since nfs mounting usually requires a lot of crap (portmap/rpc.statd/etc...)
(In reply to comment #5) > so what exactly is the trouble ? > > the nfsmount init.d script is for nfs clients and handles mounting/unmounting > of nfs Starting that service resolves the problem. nfs mounts are unmounted before network is shutdown. Seems to only be a problem when clients mount nfs shares via /etc/fstab, but don't use /etc/init.d/nfsmount. In my case the shares are not mounted automatically. Only on user request. But I will start service, and that should resolve this bug. Unless you all want to add a safe guard or etc, in case nfs shares are mounted and nfsmount has not been started.
If netmount is not needed, I suggest we change the nfsmount script to never ever fail (just as netmount does never fail). That way we can make sure the mounts are unmounted before network goes down. > Starting that service resolves the problem. nfs mounts are unmounted before > network is shutdown. Seems to only be a problem when clients mount nfs shares > via /etc/fstab, but don't use /etc/init.d/nfsmount. They also have to remove netmount for things to break (netmount would umount all nfs-shares). IMHO adding a safeguard is not needed (unnecessary introduction of new code is a bad thing), and telling everybody to use nfsmount is just fine. Just my 2 cents.
even just the netmount init.d script should unmount nfs mounts
Well for the record I was not using either nfsmount or netmount. Just simple mounting the share when they are present or etc. So that's when the problem creeps up. Not sure if its practical to have like network shutdown scripts to check to see if any remote fs are mounted before shutting down interfaces. Would be a safeguard. But then not sure we would want network scripts unmounting the stuff at that point. Not sure if that's exceeding the scope of those scripts, cross bounds or etc. Again only in the event that neither nfsmount nor netmount is started, and remote fs's are mounted.
(In reply to comment #9) > Well for the record I was not using either nfsmount or netmount. Just simple > mounting the share when they are present or etc. So that's when the problem > creeps up. So what you do is use the netmount init script regardless. You can configure fstab not to automatically mount network shares. Anyway, I've put a patch in the baselayout-2 repo that stops localmount and halt.sh from trying to unmount network shares as the network will already be down by this point which should fix this.
(In reply to comment #10) > > Anyway, I've put a patch in the baselayout-2 repo that stops localmount and > halt.sh from trying to unmount network shares as the network will already be > down by this point which should fix this. Sweet I have another older machine with a dying nic and usually have to edit mtab manually so box won't hang when I restart. So that fix would help out in that scenario as well as the others :) Thanks much.
*** Bug 186443 has been marked as a duplicate of this bug. ***
Problem with NFSv4 (baselayout-2.0.0_rc3-r1): Playing a NFSv4 mounted file with mplayer and trying to reboot: * Unmounting network filesystems ... unmount: in use ... * Failed to simply unmount filesystems --> hang Playing a NFSv4 mounted file with audacious und trying to reboot: Aug 31 05:52:23 mattenklicker Oops: 0000 [#1] Aug 31 05:52:23 mattenklicker Modules linked in: hwmon_vid hwmon nf_nat_ftp nf_conntrack_ftp nf_nat_irc nf_conntrack_irc ipt_MA SQUERADE ipt_LOG xt_limit xt_tcpudp xt_state iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nfnetlink iptable_filter ip_tabl es x_tables nls_iso8859_1 nls_cp437 vfat fat nls_base nfs lockd nfs_acl sunrpc lp fuse fan thermal processor button ipv6 ide_ge neric rtc ide_cd cdrom nvidia(P) firmware_class ac97_bus soundcore psmouse serio_raw via82cxxx rt2500 emu10k1_gp gameport via_a gp agpgart evdev i2c_viapro parport_pc parport pcspkr ohci1394 ieee1394 generic ide_core uhci_hcd ehci_hcd 8250_pnp 8250 serial _core usbcore unix Aug 31 05:52:23 mattenklicker CPU: 0 Aug 31 05:52:23 mattenklicker EIP: 0060:[<fa497553>] Tainted: P VLI Aug 31 05:52:23 mattenklicker EFLAGS: 00010246 (2.6.21-gentoo-r4 #1) Aug 31 05:52:23 mattenklicker EIP is at nfs_update_inode+0xd3/0x6e0 [nfs] Aug 31 05:52:23 mattenklicker eax: 00000000 ebx: f0273ee0 ecx: 000081b6 edx: eb02517c Aug 31 05:52:23 mattenklicker esi: 0002020f edi: 00000000 ebp: f715acb0 esp: f5079df8 Aug 31 05:52:23 mattenklicker ds: 007b es: 007b fs: 00d8 gs: 0033 ss: 0068 Aug 31 05:52:23 mattenklicker Process umount (pid: 4709, ti=f5078000 task=f6ca3580 task.ti=f5078000) Aug 31 05:52:23 mattenklicker Stack: f6ca3580 c012d060 00000002 00000000 f5079e24 f715acb0 c01246d6 eb02517c Aug 31 05:52:23 mattenklicker eb025054 f61572c0 ffff00c1 00000000 f715ac00 00000000 f61572c0 f715acb0 Aug 31 05:52:23 mattenklicker fa4a7e7b f715ac00 eff9ffb0 ee80b9c0 eb02517c f0273ee0 f0273ee0 00000000 Aug 31 05:52:23 mattenklicker Call Trace: Aug 31 05:52:23 mattenklicker [<c012d060>] wake_bit_function+0x0/0x60 Aug 31 05:52:23 mattenklicker [<c01246d6>] sigprocmask+0x46/0xb0 Aug 31 05:52:23 mattenklicker [<fa4a7e7b>] nfs4_proc_delegreturn+0x19b/0x1a0 [nfs] Aug 31 05:52:23 mattenklicker [<fa4b3217>] nfs_do_return_delegation+0x17/0x30 [nfs] Aug 31 05:52:23 mattenklicker [<fa495c3c>] nfs_dentry_iput+0x1c/0x50 [nfs] Aug 31 05:52:23 mattenklicker [<c017288b>] shrink_dcache_for_umount_subtree+0xdb/0x1e0 Aug 31 05:52:23 mattenklicker [<c0173626>] shrink_dcache_for_umount+0x36/0x50 Aug 31 05:52:23 mattenklicker [<c0163f18>] generic_shutdown_super+0x18/0xd0 Aug 31 05:52:23 mattenklicker [<c0118776>] __cond_resched+0x16/0x40 Aug 31 05:52:23 mattenklicker [<c0164019>] kill_anon_super+0x9/0x20 Aug 31 05:52:23 mattenklicker [<fa4998ec>] nfs_kill_super+0xc/0x20 [nfs] Aug 31 05:52:23 mattenklicker [<c0164094>] deactivate_super+0x44/0x60 Aug 31 05:52:23 mattenklicker [<c0176f2d>] expire_mount_list+0x9d/0x110 Aug 31 05:52:23 mattenklicker [<c0177047>] shrink_submounts+0xa7/0xc0 Aug 31 05:52:23 mattenklicker [<c0177162>] sys_umount+0x102/0x1f0 Aug 31 05:52:23 mattenklicker [<c016567f>] sys_stat64+0xf/0x30 Aug 31 05:52:23 mattenklicker [<c01168ce>] do_page_fault+0x31e/0x610 Aug 31 05:52:23 mattenklicker [<c0177267>] sys_oldumount+0x17/0x20 Aug 31 05:52:23 mattenklicker [<c0103e2a>] sysenter_past_esp+0x5f/0x85 Aug 31 05:52:23 mattenklicker ======================= Aug 31 05:52:23 mattenklicker Code: c4 fc ff ff 83 c4 30 b8 8c ff ff ff 5b 5e 5f 5d c3 8d b4 26 00 00 00 00 8b 54 24 1c 8b 82 8 8 00 00 00 8b 98 48 01 00 00 8b 40 38 <3b> 50 08 0f 84 6d 04 00 00 8b 4c 24 20 8b 85 8c 00 00 00 89 81 Aug 31 05:52:23 mattenklicker EIP: [<fa497553>] nfs_update_inode+0xd3/0x6e0 [nfs] SS:ESP 0068:f5079df8 /etc/init.d/netmount: line 62: Segmentation fault umount -at ${fs} --> hang