[mythtv-users] remote ssh to run mythtv-setup ( ssh -X mythtv at server mythtv-setup ) hangs on exit

Stephen Worthington stephen_agent at jsw.gen.nz
Sun Jul 15 03:14:58 UTC 2018


On Sat, 14 Jul 2018 16:33:04 -0500, you wrote:

>Issue I've seen lately is it just hangs after changes are made on a
>headless mythtv install
>
>Get the dialog box that says: If you added or altered channels please run
>mythfilldatabase on the master backend to populate the database with guide
>information
>
>At that point I need to open another screen and kill the mythtv-setup
>process.  Thought it has something to do with systemd not enabled but
>appears to be something more
>
>NAME="Ubuntu"
>VERSION="16.04.4 LTS (Xenial Xerus)"
>mythtv-backend-master                2:0.28.2+fixes
>
>sudo systemctl stop mythtv-backend.service (works fine)
>Also edited /etc/sudoers
>mythtv ALL=(ALL) NOPASSWD: ALL
>
>Input would be appreciated hate crashing all the time
>Brent Bolin

On Ubuntu, remember that /usr/bin/mythtv-setup is a script that calls
/usr/bin/mythtv-setup.real.  The script still uses /usr/sbin/service
to start and stop things, which does not seem to work well if you are
using systemd.  It needs to be changed to use "systemctl start" and
"systemctl stop".  So to check if that is the problem, try manually
doing the necessary commands:

sudo systemd stop mythtv-backend
mythtv-setup.real
sudo systemd start mythtv-backend
mythfilldatabase    <===== only if needed

Also, the commands in the MythTV settings that are used to start and
stop mythbackend are usually even worse - the start command is
normally just "mythbackend" which will run mythbackend as the current
user instead of the correct user setup (root initially, then changing
to mythtv as per the settings in the mythtv-backend.service file). The
stop command is normally "killall mythbackend", which will likely have
permissions problems and be unable to kill a mythbackend that was
started as a systemd service.

These commands show the those two settings in your database:

curl -H Accept:application/json <your MythTV box
address>:6544/Myth/GetSetting?Key=BackendStartCommand\&HostName=_GLOBAL_

curl -H Accept:application/json <your MythTV box
address>:6544/Myth/GetSetting?Key=BackendStopCommand\&HostName=_GLOBAL_

These problems have not yet been fixed on 18.04 or the PPA, probably
because they are not simple.

I normally run mythtv-setup.real manually, to avoid these problems, so
I have not yet gotten around to testing what commands will work from
the MythTV settings.  I suspect that just putting "systemctl start
mythtv-backend" and "systemctl stop mythtv-backend" will not work due
to permissions problems, in which case a "helper" batch file will be
needed that can issue those commands.  Such a helper file is owned by
root but runnable by the MythTV group users, and is put in the sudoers
file with the right permissions there.  It would accept a "start" or
"stop" command as a parameter and execute the appropriate systemctl
command with root permissions.

However, for your particular problem, is it the mythtv-setup script
that is failing to stop, or is it mythtv-setup.real?  If it is the
script, then it is likely the above problem, but if it is
mythtv-setup.real, and you are not telling mythtv-setup.real to stop
or start mythbackend, then it is going to be something different.


More information about the mythtv-users mailing list