[mythtv-users] shutdown problems in ubuntu, looks like imon

Mark Lord mythtv at rtr.ca
Fri May 27 13:18:22 UTC 2011


On 11-05-27 08:34 AM, Henrik wrote:
> Hi,
> 
> I´m having shutdown issues on the latest ubuntu, mythtv seems to work
> perfect but sometimes shutdoen hangs, clock keeps going on the vfd but
> the machine is locked.
> Ctrl-Alt-Del from a keyboard makes it reboot (usualy), since I
> blacklisted the imon module everything has worked flawless.
> 
> Any other imon using mythtv people out there who have suggestions or
> experience on this?

The Ubuntu shutdown "sequence" is as b0rked as their startup sequence,
with loads of timing dependencies.  It simply doesn't work if one has
the right/wrong combination of devices at the right speeds.

This is due to their use of "upstart", which was supposed to solve
the exact problems it creates.  The older sysv-init style at least
guaranteed a "sequence".

I've tweaked my Ubuntu-based mythtv box, replacing many of the upstart
bits with scripts that do things In The Correct Order, both for startup
(eg. ensure network is up before trying to access HDHomeRun tuners)
and for shutdown (eg. ensure mythbackend stops _before_ mysqld does).

As well, I got weary of seeing the system poweroff/reboot before it
had finished umounting/syncing the root filesystem, so I hardcoded that
in the halt script as well.

There's also something buggered in the initramfs image at boot time,
as about 30% of the time it fails to find my recordings drive
and hangs.  So I've rebuilt a custom kernel to avoid the need for
the initramfs scripts altogether.

Back to shutdown.. I noticed a kernel bug three years ago for SMP shutdown,
causing it to hang at the critical moment, probably due to an SMI interrupt
or something.  But any attempt to instrument/trace the issue makes it go away.

So I added some printk()s to the kernel poweroff code, and enabled the
serial console at 115200/8n1, and this seems to be enough to prevent the hang.

But just to make sure, I also enable/arm the hardware watchdog timer
that is built into all modern Intel chipsets.. if the system hangs, it will
reset the motherboard within a minute two (configurable).  Useful, that,
though I did have to patch it to force it on at boot time, to catch hangs
(Ubuntu) that might occur before userspace would have a chance to enable it.

That's a surprising amount of effort needed to make a recent distro (10.10)
work reliably, and it's really got me looking to pure Debian again for the
next go around.

Cheers


More information about the mythtv-users mailing list