[mythtv-users] mythbackend service not reliably closing via script

Ian Clark mrrooster at gmail.com
Wed Apr 6 14:27:52 UTC 2011


[snip]
On 6 April 2011 12:02, Tim Draper <veehexx at gmail.com> wrote:
> thanks for the advice. i'm pretty sure i already tried this with no luck
> (sudo the script, and not sudo inside the script), but worth giving it
> another go just to be sure.

What user runs the script? How much do you 'care' about the machine?

You can set sudo up to not require a password if you think this may be
the issue?

In my /etc/sudoers I have:-

mythtv  ALL= NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/shutdown,
/home/mythtv/bin/wakeup.sh, /usr/local/mythtv/bin/mythwelcome,
/home/mythtv/bin/wakeupat.sh, /usr/sbin/pm-suspend, /etc/init.d/mythtv

This allows the mythtv user to run any of the listed commands as root.
However I've just realised you said myth does 'sudo
/usr/sbin/pm-suspend' which means the pm-suspend script is running as
root, so the sudo won't ask for a password (if it's not quite set up
right it might print an error when run though, which /may/ be stopping
things, although I'd expect things to exit, not lock up.)

Have you tried removing the sudo from the stop command in the
pm-suspend script? (as this should be running as root)

I wonder if it's failing because you're trying to stop myth from a
process spawned by myth, so there's some deadlocking as myth doesn't
quit until the script has returned, which is trying to quit myth? You
may be able to background it to get it to work, but that's probably
quite non deterministic.

Personally, as it's just a mythbox I think a 'pkill mythbackend' is fine.

Cheers,

Ian


More information about the mythtv-users mailing list