[mythtv-users] Sudoers fix for MythTV builtin commands requiring sudo systemctl

Janusz S. Bień jsbien at mimuw.edu.pl
Sun Jul 14 07:37:56 UTC 2019

On Sun, Jul 14 2019 at  5:18 +12, Stephen Worthington wrote:


> I have created what I hope is a good workaround for this problem on
> Ubuntu 18.04, and it should also work on Ubuntu 16.04.  It uses an
> entry in sudoers to allow a helper script to be run with sudo to
> execute the correct systemctl commands.
> Here is the /etc/sudoers.d/mythtv-systemctl-helper file:
> mythtv,%mythtv
> ALL=NOPASSWD:/home/mythtv/bin/mythtv-systemctl-helper.sh

I don't have /home/mythtv in my Debian stable (buster) installation, I
replaced it everywhere by my home directory.


> Once the above install is done, you should be able to test it by
> running commands like this from your mythfrontend user:
> sudo /home/mythtv/bin/mythtv-systemctl-helper.sh stop
> That command should stop mythbackend, and it should not ask you for
> authentication as sudo normally does.

It stops the backend in the sense that systemctl status mythtv-backend
reports "Active: inactive (dead)", but setup still claims the backend is
running (I wrote about it in one of my previous mail). Annoying but
without consequences (at least this is mine impression).

> If that works, then you need to make the following MythTV settings
> changes:
> mythtv-setup > 1. General > Shutdown/Wakeup Options > Server halt
> command:
>   sudo /home/mythtv/bin.mythtv-systemctl-helper.sh halt

   sudo /home/mythtv/bin/mythtv-systemctl-helper.sh halt

> mythtv-setup > 1. General > Backend Control > Backend stop command:
>   sudo /home/mythtv/bin.mythtv-systemctl-helper.sh stop

   sudo /home/mythtv/bin/mythtv-systemctl-helper.sh stop

> mythtv-setup > 1. General > Backend Control > Backend start command:

>   sudo /home/mythtv/bin.mythtv-systemctl-helper.sh start

  sudo /home/mythtv/bin.mythtv-systemctl-helper.sh start

In my setup I don't see "Shutdown/Reboot Settings" (but can live with

> mythfrontend > Setup > General > Shutdown/Reboot Settings > Halt
> command:
>   sudo /home/mythtv/bin.mythtv-systemctl-helper.sh poweroff
> mythfrontend > Setup > General > Shutdown/Reboot Settings > Reboot
> command:
>   sudo /home/mythtv/bin.mythtv-systemctl-helper.sh reboot


> Please consider this to be beta software - I make no guarantees that
> it will work on your system, but it does work on mine and I would like
> to have some other people test it too.

Works on mine (at least seems to).

Thank you very much!

Best regards


Janusz S. Bien
emeryt (emeritus)

More information about the mythtv-users mailing list