Augh... Automatic shutdown, at wit's end!

Right… after having far too many problems with other brown-coloured distros, I moved my MythTV box to SuSE (what all the other machines here use).

Everything is working, EXCEPT for one thing: automatic idle shutdown.

I cannot get MythWelcome to shut down the machine automatically (choosing shutdown now from it’s menu does work). The log shows
sudo: sorry, a password is required to run sudo (sudo -n)
or the infamous “no tty and no askpass”. (plain sudo)

I have added /sbin/shutdown to the sudoers file, and I can run sudo /sbin/shutdown -h now from the terminal and shutdown without a password… but sudo will NOT run from mythtv.

I’ve even tried adding a special exception to the sudoers file, “Defaults !requiretty” with no luck.

This is a dedicated frontend/backend with no user access (doesn’t boot a desktop manager; goes straight to Mythtv) so I’m no too worried about potential security; the machine is on a LAN and cannot be accessed from the WAN side.

What can I do?

I do not know very much about this MythTV, so this is only a guess. Is the user running he MythTV process the same as the user you use to log in with and test all these *sudu shutdown *things?

Yep… The box is doing autologin as me and firing up mythfrontend.
I’ll double-check to be sure.

A-HA. That was, and wasn’t the cause. The MythWelcome and Mythfrontend processes were running under my UID/GID, but the backend process was NOT. (it was trying to use a nonexistent UID.)
I had assumed that the frontend was in control of the shutdown, since it displays the countdown timer and interface.

A quick tweak to /etc/init.d/mythbackend and we’re golden!

That’s what I love about Linux; there are a million ways to solve a problem, but after you try ~10 of them, you find a one-liner that could have saved you a day.

You are welcome. I have the habit of not running any services to others (or even myself) from my own user. Better nmake a new user for the web-site, non-root management functions, etc.etc.
I thought that such a good practice mightbe applicable here. And it is.