[mythtv-users] Fwd: Re: Fwd: Re: Mythfrontend freezing and VDPAU?
Allen Edwards
allen.p.edwards at gmail.com
Thu Mar 5 15:19:49 UTC 2020
On Wed, Mar 4, 2020 at 6:34 PM Stephen Worthington <stephen_agent at jsw.gen.nz>
wrote:
> On Wed, 4 Mar 2020 10:23:57 -0800, you wrote:
>
> >>
> >> I just put those 2 (with some extra checking) eg:
> >>>
> >>
> >> #!/bin/bash
> >> while true ; do
> >> systemctl isolate multi-user.target
> >> if [ $? -eq 0 ]; then
> >> systemctl isolate graphical.target
> >> exit 0
> >> fi
> >> sleep 1
> >> done
> >>
> >> (something along those lines - untested)
> >> Put in a script and call the script from irexec
> >>
> >>
> >>
> >>> Allen
> >>>
> >>> _______________________________________________
> >>
> >>
> >I tested the script suggested and found two problems.
> >1) I need to call my script with sudo. I don't know how to do that but if
> >it works on the next myth lockup I assume I can figure it out or ask for
> >help.
> >2) I had to change one line so the script is now
> >#!/bin/bash
> > while [ true ]; do
> > systemctl isolate multi-user.target
> > if [ $? -eq 0 ]; then
> > systemctl isolate graphical.target
> > exit 0
> > fi
> > sleep 1
> > done
> >
> >I obviously cannot test it from the local terminal but it works fine from
> >my desktop upstairs. My plan is to try this the next time that myth hangs
> >up so I can confirm that it works under the actual locked conditions. My
> >fear is that it is the video card itself that is hung and that this will
> >not clear it.
> >
> >Putting it in a button should be easy but not sure about the permissions
> >part.
> >
> >Allen
>
> Any script or program can be set up in the /etc/sudoers file (or
> better in /etc/sudoers.d) to be able to be run with sudo without
> asking for a password. If you still want proper security, you need to
> make sure that anyone who can run the script is unable to modify it,
> so write permission should be set to root only. I do this for my
> mythtv-systemctl-helper.sh file that is run from mythfrontend to shut
> down or restart the system.
>
> See this post for full details:
>
> https://lists.gt.net/mythtv/users/625993
> _______________________________________________
>
Thank you for this. I have modified my killgui.sh file to add sudo
*#!/bin/bash while [ true ]; do sudo systemctl
isolate multi-user.target if [ $? -eq 0 ]; then
sudo systemctl isolate graphical.target exit 0
fi sleep 1 done*
I created a test file that will only run with root permissions and put it
in /etc/sudoers.d/ and changed the permissions and it runs.
*chown root:mythtv*
*chmod ug=rx,o=*
My plan is to wait until I have a real lockup and run the file manually.
When that test is successful, I will modify* /home/dad/.mythtv/lircrc* like
this
*config = /etc/sudoers.d/killgui.sh &*
Hopefully I have this all correct. Please let me know if I screwed
anything up :-)
Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20200305/667546a0/attachment.htm>
More information about the mythtv-users
mailing list