[mythtv-users] ACPI

Stephen Worthington stephen_agent at jsw.gen.nz
Mon Sep 14 09:57:29 UTC 2020


On Sun, 13 Sep 2020 13:39:36 -0400, you wrote:

>I hope this result will confirm that I have followed your instruction:
>
>daryl at trieli:~$ ls -al /etc/sudoers.d/acpi
>-r--r----- 1 root root 162 Sep 13 09:45 /etc/sudoers.d/acpi

Yes, that is good.

>daryl at trieli:~$ sudo cat /etc/sudoers.d/acpi
>#instead of adding directly to sudoers file, this file was created
>
>#mythtv,%mythtv ALL = NOPASSWD: /sbin/shutdown, /usr/bin/setwakeup.sh, /usr/bin/checklogin.sh

Presuming that extra spaces are fine, that should work once the line
above is uncommented by removing the #.  The only required space in
that line is the one between %mythtv and ALL.  The others are just for
readability and I have not put them in my sudoers line.

>daryl at trieli:~$ ls -al /sbin/shutdown
>lrwxrwxrwx 1 root root 14 Jul  6 17:38 /sbin/shutdown -> /bin/systemctl
>daryl at trieli:~$ ls -al /usr/bin/setwakeup.sh
>-r-xr-xr-x 1 root mythtv 1221 Sep 10 16:37 /usr/bin/setwakeup.sh

The permissions are allowing this file to be executed by anyone
(o=rx).  It should have o=r.  So "sudo chmod o=r
/usr/bin/setwakeup.sh".  I also prefer to never put things in system
directories like /usr/bin if I can help it, so I would put the
setwakeup.sh file in /usr/local/bin and change the acpi file to point
to that location.

>daryl at trieli:~$ ls -al /usr/bin/checklogin.sh
>-r-xr-xr-x 1 root mythtv 1222 Sep 10 16:47 /usr/bin/checklogin.sh

Again, it has o=rx allowing any user to run it.  It needs to be o=r,
so only mythtv group users or root can run it.

I have not checked the contents posted for the setwakeup.sh and
checklogin.sh files as I have never used them.  I presume that they
are just copied from the Wiki page and therefore should work, but as I
understand it, it does depend on your BIOS.  Some BIOSes are buggy and
to not do timer wakeups properly.


More information about the mythtv-users mailing list