Bug Description

When I shut down from my user account, the system hangs after the message "Stopping samba daemons... [ OK ]". At that point the system does not respond to anything except holding down the power button for five seconds. When I shut down as root, the system hangs after the message "Stopping bus messaging daemon dbus [ OK ]". It sits indefinitely until either CTL-ALT-DEL or a single press of the power button force reboot or shutdown. This problem seemed to start randomly without any new packages added. Any help is much appreciated.

Thanks for taking the time to report this bug and helping to make Ubuntu better. Unfortunately we can't fix it, because your description doesn't yet have enough information.
Please include as attachments the following additional information, if you have not already done so (please pay attention to lspci's additional options), as required by the Ubuntu Kernel Team:
1. Please include the output of the command 'uname -a' in your next response. It should be one, long line of text which includes the exact kernel version you're running, as well as the CPU architecture.
2. Please run the command 'sudo dmidecode > dmidecode.log' and attach the resulting file 'dmidecode.log' to this bug report.
For your reference, the full description of procedures for kernel-related bug reports is available at https://wiki.ubuntu.com/KernelTeamBugPolicies . Thanks in advance!

This seems quite similar to https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/114854. You can quickly test this hypothesis by adding 'reboot=b' to the kernel boot command. The easiest way is to catch it at the grub menu, enter 'e' to edit the boot entry, then 'e' to edit the kernel command. Replace 'quiet splash' with 'reboot=b'. If that works, then try a test kernel to make sure it is fixed:

If you look at reboot man page tou can see:
" -i Iterates configured network interfaces and brings them down before shutting down. On Linux, this is unnecessary
as the kernel will do this anyway."
so you can remove the "-i" flag from the init script where the call shutdown and halt.
I'll attach the patch for ubuntu 8.04.

This will change shutdown behaviour for all existing hardy installations, which is too risky in an SRU (it might break things for other people), at least as long as this hasn't been done in any stable release. So if that's the correct fix, it should be applied to jaunty, get widespread testing there, and then be backported.

However, it doesn't look like a "correct" fix to me in the first place. Why should samba hang or not just because the halt init script (which is run *after* any other init script) shuts down network interfaces? It shouldn't hurt at all to keep them up all the time.

What kind of network interfaces do you have? does it make a difference when you disconnect it before shutdown?

You're right Martin, it's not a fix but a workaround for the problem, the strange thing is that manpages for reboot and halt say "On Linux, this is unnecessary as the kernel will do this anyway.", but removing the flag resolves the issue.
My server is in production, so I can't make more tests, if someone else affected by the problem can please give feedback. The NICs are 2 intel 82572EI Gigabit Ethernet and 2 Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet.
I haven't tested on newer kernel (Intrepid).