<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Dec 7, 2019 at 1:56 AM Stephen Worthington <<a href="mailto:stephen_agent@jsw.gen.nz">stephen_agent@jsw.gen.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 6 Dec 2019 14:00:00 -0500, you wrote:<br>
<br>
>Greetings Mythizens, Because my system does not shut down gracefully<br>
>(Gigabyte mobo that cooperates with windows, but not Ubuntu) I've been<br>
>leaving it on 24/7. I finally got new wallwarts for both of my HDHR's and<br>
>still have unreliable recording performance from them. One box failed on<br>
>both recordings about ten minutes in, and then the other after 15 minutes,<br>
>so I gave the first unit higher priority in my router as well as a fixed<br>
>IP, and tested again with similar results. Then after some googling I tried<br>
>powering them down for about 15 mins, then testing again, with success. Can<br>
>Mythtv reboot these devices prior to putting them to use? I used to wake<br>
>the box as needed, but since the mobo doesn't cooperate and the backend is<br>
>up before the HDHRs are capable of responding... well you see my situation,<br>
>any suggestions?  TIA  Daryl<br>
<br>
I am not sure rebooting the HDHRs will help.  You shut them down,<br>
rather than rebooting.  So it could be a temperature problem, and they<br>
cooled down enough while they were off to be able to complete a<br>
recording once they were restarted.  So you need to test whether a<br>
reboot is all that is required, or whether they actually need to be<br>
shut down for a while.  And you could try just pointing a fan at them<br>
to see if that helps.<br>
<br>
Also, what do you mean by "backend is up before the HDHRs are capable<br>
of responding"?  Since you are using network tuners, you should have<br>
the fix installed that causes mythbackend to wait until the HDHR<br>
tuners are available before it starts.  But if you did not have that<br>
fix, the HDHRs would often not work at all after the box is booted,<br>
until you restarted mythbackend.  But that is not the problem you seem<br>
to be describing.<br>
<br>
As for the problem with shutting down the motherboard, if it shuts<br>
down in Windows, then it is clearly able to be made to shut down<br>
properly, once you find out what in Ubuntu is causing it not to shut<br>
down.  That can be quite difficult, but it is possible.  I have had<br>
problems like that, and what I found was the best way to diagnose<br>
shutdown problems was to do this:<br>
<br>
sudo systemctl enable debug-shell.service<br>
<br>
which enables a root debug console on Ctrl-Alt-F9 that comes up very<br>
early during boot and goes away very late during shutdown.  It does<br>
not require a login (as it comes up before logging in is possible) and<br>
hence is a serious security problem when enabled, but it is able to be<br>
used to tell you what is happening when Ubuntu fails to shut down or<br>
shuts down very slowly.  Once you have a debug console, then you can<br>
try shutting down.  When the shutdown is happening, use Ctrl-Alt-F9 to<br>
go to the debug console and use commands like:<br></blockquote><div><br></div><div>So before I enable the debug-shell.service is disabling it as easy as:</div><div><br></div><div>sudo systemctl disable debug-shell.service     ? If I hear you correctly, I don't want to leave myself open any longer than necessary (the debug process) ?<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
systemctl list-jobs<br>
<br>
to see what is still running, what is waiting to be run and so on. You<br>
will normally find one or more jobs that are waiting a long time for<br>
something to happen, such as a network connection to shut down or a<br>
non-existent (network or local) drive to be mounted so that it can be<br>
unmounted.<br>
<br>
One thing that catches most MythTV users is the problem that<br>
mythbackend has a shut down bug itself, and fails to shut down<br>
completely when asked to by systemd.  Systemd then does a long timeout<br>
before finally killing mythbackend using a kill -9 call.  I think that<br>
takes 60 or 90 seconds, and it delays other things from getting shut<br>
down also.  What happens in mythbackend is that most of it is shut<br>
down, but at least one thread fails to stop.  If it is given a second<br>
normal shutdown request shortly after the first one, it will shut down<br>
immediately then.  The fix I have for this problem is to put this line<br>
in the [service] section of your systemd override file for<br>
mythtv-backend:<br>
<br>
ExecStop=/usr/local/bin/mythbackendstop.sh<br>
<br>
and put a copy of my mythbackendstop.sh file in your /usr/local/bin<br>
directory:<br>
<br>
#!/bin/bash<br>
PID=$(systemctl show -p MainPID mythtv-backend.service 2>/dev/null |<br>
cut -d= -f2)<br>
if [ "$PID" != "0" ]; then<br>
    kill -15 $PID<br>
    sleep 1<br>
    kill -15 $PID<br>
fi<br>
<br>
<br>
which you can do by downloading it from my web server:<br>
<br>
sudo su<br>
cd /usr/local/bin<br>
wget <a href="http://www.jsw.gen.nz/mythtv/mythbackendstop.sh" rel="noreferrer" target="_blank">http://www.jsw.gen.nz/mythtv/mythbackendstop.sh</a><br>
chown root:root mythbackendstop.sh<br>
chmod u=rwx,g=rx,o=rx mythbackendstop.sh<br>
exit<br>
<br>
It is also a good idea to put these two lines in the [service] section<br>
as well, as a backup in case mythbackend is locked up and really needs<br>
a kill -9:<br>
<br>
SendSIGKILL=yes<br>
TimeoutStopSec=10<br>
<br>
That will do a kill -9 after 10 seconds if mythbackend still does not<br>
shut down.<br>
<br>
My override file for mythbackend is:<br>
<br>
/etc/systemd/system/mythtv-backend.service.d/mythtv-backend-override.conf<br>
<br>
but yours (if it exists) may have a different name.  The name does not<br>
matter as long as it is a .conf file.  The easy way to create or edit<br>
one these days (as long as your systemd has been updated) is:<br>
<br>
sudo systemctl edit mythtv-backend<br>
_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org" target="_blank">mythtv-users@mythtv.org</a><br>
<a href="http://lists.mythtv.org/mailman/listinfo/mythtv-users" rel="noreferrer" target="_blank">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a><br>
<a href="http://wiki.mythtv.org/Mailing_List_etiquette" rel="noreferrer" target="_blank">http://wiki.mythtv.org/Mailing_List_etiquette</a><br>
MythTV Forums: <a href="https://forum.mythtv.org" rel="noreferrer" target="_blank">https://forum.mythtv.org</a><br>
</blockquote></div></div>