[mythtv-users] Restarting frontend on suspend (WAS: 0.24+fixes - tearing, /dev/rtc permissions and getting openGL to work)

David Edwards david at more.fool.me.uk
Wed Mar 2 10:01:20 UTC 2011


On 1 March 2011 16:34, mark pennock <markitman2 at gmail.com> wrote:
> How do you kill and then restart mythfrontend with suspend.

My solution to this is a bit of a hack... I only suspend the machine
via the power button on my remote. I have LIRC set up to run a little
script for the power button, which runs (amongst other things like
turning my TV and amp off/on via RS-232):

killall -9 mythfrontend.real
sudo /usr/sbin/pm-suspend
mythfrontend

So it brutally kills the process, suspends, and then starts a new
frontend process when the script carries on after resume.

If you wanted to make it work when the machine is suspended via other
routes (eg, desktop menu, power button on the box), then the approach
I would try would be to add script in /etc/pm/sleep.d/. You would need
to make the frontend start as the correct user on the correct display,
etc. Or, you could use a script in sleep.d to just kill the process
and rely on one of the scripts from
http://www.mythtv.org/wiki/Frontend_Loading_Script to automatically
restart the frontend when it dies, which would in theory be after the
machine resumes.

David


More information about the mythtv-users mailing list