Mailing List Archive

New install Xubuntu 20.04
Hi All

This is  mainly for Stephen.

I am continuing to fine tune my new install and have identified a
problem with Stephen's Systemctl helper scripts in Xubuntu 20.04.

With the server halt command in BE shutdown/wake up options set as :
"sudo /usr/local/bin/mythtv-systemctl-helper.sh poweroff" the BE
attempts to shutdown after being idle for 300 seconds as per the
settings dictate . The shutdown gets as far as the Xubuntu splash with
the rotating indicator then locks up - the rotating indicator freezes.

The only way to escape this is to do a hard reset on the system - magic
SysRq does not work.

I have tried all the mythtv-systemctl-helper.sh options from the
terminal and they all work fine.

Reverting the server halt command in BE back to sudo sh -c "mythshutdown
-- shutdown"   makes everything work normal.

The back end start and stop commands in  Backend Control settings, that
use mythtv-systemctl-helper.sh poweroff don't seem to be a problem (so far)

I'm using ACPI wake up on this system but this shutdown lock up problem
showed up before I enabled Mythwelcome .

With Mythwelcome enabled and using the default server halt command ,
everything seems to work fine. Mythwelcome shuts the system down if
there are no recordings in the near future and starts the system in time
to record programmes.

The setup I'm using comes from this tutorial:
http://gedakc.users.sourceforge.net/display-doc.php?name=pvr-mythtv-auto-wakeup
<http://gedakc.users.sourceforge.net/display-doc.php?name=pvr-mythtv-auto-wakeup>

My current system is Mythbuntu 16.04 and does not use the helper scripts
and does not seem to have any problems.


-Paul
New install Xubuntu 20.04 [ In reply to ]
Hi All

This is  mainly for Stephen.

I am continuing to fine tune my new install and have identified a
problem with Stephen's Systemctl helper scripts in Xubuntu 20.04.

With the server halt command in BE shutdown/wake up options set as :
"sudo /usr/local/bin/mythtv-systemctl-helper.sh poweroff" the BE
attempts to shutdown after being idle for 300 seconds as per the
settings dictate . The shutdown gets as far as the Xubuntu splash with
the rotating indicator then locks up - the rotating indicator freezes.

The only way to escape this is to do a hard reset on the system - magic
SysRq does not work.

I have tried all the mythtv-systemctl-helper.sh options from the
terminal and they all work fine.

Reverting the server halt command in BE back to sudo sh -c "mythshutdown
-- shutdown" makes everything work normal.

The back end start and stop commands in  Backend Control settings, that
use mythtv-systemctl-helper.sh poweroff don't seem to be a problem (so far)

I'm using ACPI wake up on this system but this shutdown lock up problem
showed up before I enabled Mythwelcome .

With Mythwelcome enabled and using the default server halt command ,
everything seems to work fine. Mythwelcome shuts the system down if
there are no recordings in the near future and starts the system up
again in time to record scheduled programmes.

The setup I'm using comes from this tutorial:
http://gedakc.users.sourceforge.net/display-doc.php?name=pvr-mythtv-auto-wakeup
<http://gedakc.users.sourceforge.net/display-doc.php?name=pvr-mythtv-auto-wakeup>

My current system is Mythbuntu 16.04 and does not use the helper scripts
(I think the install predates them)  and does not seem to have any problems.


-Paul
Re: New install Xubuntu 20.04 [ In reply to ]
On Sat, 10 Jul 2021 15:40:42 +1200, you wrote:

>Hi All
>
>This is  mainly for Stephen.
>
>I am continuing to fine tune my new install and have identified a
>problem with Stephen's Systemctl helper scripts in Xubuntu 20.04.
>
>With the server halt command in BE shutdown/wake up options set as :
>"sudo /usr/local/bin/mythtv-systemctl-helper.sh poweroff" the BE
>attempts to shutdown after being idle for 300 seconds as per the
>settings dictate . The shutdown gets as far as the Xubuntu splash with
>the rotating indicator then locks up - the rotating indicator freezes.
>
>The only way to escape this is to do a hard reset on the system - magic
>SysRq does not work.
>
>I have tried all the mythtv-systemctl-helper.sh options from the
>terminal and they all work fine.
>
>Reverting the server halt command in BE back to sudo sh -c "mythshutdown
>-- shutdown"   makes everything work normal.
>
>The back end start and stop commands in  Backend Control settings, that
>use mythtv-systemctl-helper.sh poweroff don't seem to be a problem (so far)
>
>I'm using ACPI wake up on this system but this shutdown lock up problem
>showed up before I enabled Mythwelcome .
>
>With Mythwelcome enabled and using the default server halt command ,
>everything seems to work fine. Mythwelcome shuts the system down if
>there are no recordings in the near future and starts the system in time
>to record programmes.
>
>The setup I'm using comes from this tutorial:
>http://gedakc.users.sourceforge.net/display-doc.php?name=pvr-mythtv-auto-wakeup
><http://gedakc.users.sourceforge.net/display-doc.php?name=pvr-mythtv-auto-wakeup>
>
>My current system is Mythbuntu 16.04 and does not use the helper scripts
>and does not seem to have any problems.
>
>
>-Paul

I have never tested my helper scripts with mythwelcome - I do not do
automatic shutdown and wakeup. My scripts just use the systemd
poweroff command, which is what is normally used for manual shutdowns.
It will not program a wakeup time, as mythwelcome does.

So, first, does running "sudo poweroff" shut down the PC, or does it
show the same problem?

Next, from the same user you run mythfrontend from, try manually
running the helper script:

sudo mythtv-systemctl-helper.sh poweroff

If it is set up correctly, that command should work without prompting
for a password. To make sure it is not needing a password, you need
to run that command straight after a boot before you have done any
sudo commands.

Also, in order for systemd to be able to shut down mythbackend without
a long timeout, you need to have installed my fix for that. See:

https://lists.archive.carbon60.com/mythtv/users/628020

and search for "mythbackendstop.sh".

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: New install Xubuntu 20.04 [ In reply to ]
On 10/07/21 11:02 pm, Stephen Worthington wrote:
> On Sat, 10 Jul 2021 15:40:42 +1200, you wrote:
>
>> Hi All
>>
>> This is  mainly for Stephen.
>>
>> I am continuing to fine tune my new install and have identified a
>> problem with Stephen's Systemctl helper scripts in Xubuntu 20.04.
>>
>> With the server halt command in BE shutdown/wake up options set as :
>> "sudo /usr/local/bin/mythtv-systemctl-helper.sh poweroff" the BE
>> attempts to shutdown after being idle for 300 seconds as per the
>> settings dictate . The shutdown gets as far as the Xubuntu splash with
>> the rotating indicator then locks up - the rotating indicator freezes.
>>
>> The only way to escape this is to do a hard reset on the system - magic
>> SysRq does not work.
>>
>> I have tried all the mythtv-systemctl-helper.sh options from the
>> terminal and they all work fine.
>>
>> Reverting the server halt command in BE back to sudo sh -c "mythshutdown
>> -- shutdown"   makes everything work normal.
>>
>> The back end start and stop commands in  Backend Control settings, that
>> use mythtv-systemctl-helper.sh poweroff don't seem to be a problem (so far)
>>
>> I'm using ACPI wake up on this system but this shutdown lock up problem
>> showed up before I enabled Mythwelcome .
>>
>> With Mythwelcome enabled and using the default server halt command ,
>> everything seems to work fine. Mythwelcome shuts the system down if
>> there are no recordings in the near future and starts the system in time
>> to record programmes.
>>
>> The setup I'm using comes from this tutorial:
>> http://gedakc.users.sourceforge.net/display-doc.php?name=pvr-mythtv-auto-wakeup
>> <http://gedakc.users.sourceforge.net/display-doc.php?name=pvr-mythtv-auto-wakeup>
>>
>> My current system is Mythbuntu 16.04 and does not use the helper scripts
>> and does not seem to have any problems.
>>
>>
>> -Paul
> I have never tested my helper scripts with mythwelcome - I do not do
> automatic shutdown and wakeup. My scripts just use the systemd
> poweroff command, which is what is normally used for manual shutdowns.
> It will not program a wakeup time, as mythwelcome does.
>
> So, first, does running "sudo poweroff" shut down the PC, or does it
> show the same problem?
>
> Next, from the same user you run mythfrontend from, try manually
> running the helper script:
>
> sudo mythtv-systemctl-helper.sh poweroff
>
> If it is set up correctly, that command should work without prompting
> for a password. To make sure it is not needing a password, you need
> to run that command straight after a boot before you have done any
> sudo commands.
>
> Also, in order for systemd to be able to shut down mythbackend without
> a long timeout, you need to have installed my fix for that. See:
>
> https://lists.archive.carbon60.com/mythtv/users/628020
>
> and search for "mythbackendstop.sh".
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/


Thanks Stephen

I had installed   mythtv-systemctl-helper.sh but I went through the
procedure again ,setting the permissions.

Also  I put:

SendSIGKILL=yes
TimeoutStopSec=10

in mythtv-backend-override.conf  which I had missed doing


It shuts down without locking up when I use the reboot or shutdown
options from the frontend esc menu.

I have used your mythtv-systemctl-helper.sh commands in Mythwelcome set
up and will do some testing to check that they work.

Cheers

Paul


_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: New install Xubuntu 20.04 [ In reply to ]
On 10/07/21 11:02 pm, Stephen Worthington wrote:
> On Sat, 10 Jul 2021 15:40:42 +1200, you wrote:
>
>> Hi All
>>
>> This is  mainly for Stephen.
>>
>> I am continuing to fine tune my new install and have identified a
>> problem with Stephen's Systemctl helper scripts in Xubuntu 20.04.
>>
>> With the server halt command in BE shutdown/wake up options set as :
>> "sudo /usr/local/bin/mythtv-systemctl-helper.sh poweroff" the BE
>> attempts to shutdown after being idle for 300 seconds as per the
>> settings dictate . The shutdown gets as far as the Xubuntu splash with
>> the rotating indicator then locks up - the rotating indicator freezes.
>>
>> The only way to escape this is to do a hard reset on the system - magic
>> SysRq does not work.
>>
>> I have tried all the mythtv-systemctl-helper.sh options from the
>> terminal and they all work fine.
>>
>> Reverting the server halt command in BE back to sudo sh -c "mythshutdown
>> -- shutdown"   makes everything work normal.
>>
>> The back end start and stop commands in  Backend Control settings, that
>> use mythtv-systemctl-helper.sh poweroff don't seem to be a problem (so far)
>>
>> I'm using ACPI wake up on this system but this shutdown lock up problem
>> showed up before I enabled Mythwelcome .
>>
>> With Mythwelcome enabled and using the default server halt command ,
>> everything seems to work fine. Mythwelcome shuts the system down if
>> there are no recordings in the near future and starts the system in time
>> to record programmes.
>>
>> The setup I'm using comes from this tutorial:
>> http://gedakc.users.sourceforge.net/display-doc.php?name=pvr-mythtv-auto-wakeup
>> <http://gedakc.users.sourceforge.net/display-doc.php?name=pvr-mythtv-auto-wakeup>
>>
>> My current system is Mythbuntu 16.04 and does not use the helper scripts
>> and does not seem to have any problems.
>>
>>
>> -Paul
> I have never tested my helper scripts with mythwelcome - I do not do
> automatic shutdown and wakeup. My scripts just use the systemd
> poweroff command, which is what is normally used for manual shutdowns.
> It will not program a wakeup time, as mythwelcome does.
>
> So, first, does running "sudo poweroff" shut down the PC, or does it
> show the same problem?
>
> Next, from the same user you run mythfrontend from, try manually
> running the helper script:
>
> sudo mythtv-systemctl-helper.sh poweroff
>
> If it is set up correctly, that command should work without prompting
> for a password. To make sure it is not needing a password, you need
> to run that command straight after a boot before you have done any
> sudo commands.
>
> Also, in order for systemd to be able to shut down mythbackend without
> a long timeout, you need to have installed my fix for that. See:
>
> https://lists.archive.carbon60.com/mythtv/users/628020
>
> and search for "mythbackendstop.sh".
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/


It seems I spoke too soon.

If I let the mythwelcome screen time out when idle (300 secs) the system
shutsdown and freezes on the splash screen.

btw. I ran the mythtv-systemctl-helper commands from the terminal and
there was no prompt for a password and they worked fine.

I'm not too fussed about it - my current system has run 16.04 fine since
2017 with no mythtv-systemctl-helper script.

I don't believe it has anything to do with Mythwelcome - as I said
previously,it was doing this lock up before I enabled Mythwelcome when
the BE idle timeout shut the system down.

I use MythTV Control Panel to set up the system , maybe that has
something to do with it.

-Paul



_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: New install Xubuntu 20.04 [ In reply to ]
On Sun, 11 Jul 2021 14:54:52 +1200, you wrote:

>It seems I spoke too soon.
>
>If I let the mythwelcome screen time out when idle (300 secs) the system
>shutsdown and freezes on the splash screen.
>
>btw. I ran the mythtv-systemctl-helper commands from the terminal and
>there was no prompt for a password and they worked fine.
>
>I'm not too fussed about it - my current system has run 16.04 fine since
>2017 with no mythtv-systemctl-helper script.
>
>I don't believe it has anything to do with Mythwelcome - as I said
>previously,it was doing this lock up before I enabled Mythwelcome when
>the BE idle timeout shut the system down.
>
>I use MythTV Control Panel to set up the system , maybe that has
>something to do with it.

I would doubt that. MCC just does the same things as you would have
to do manually without it.

>-Paul

If you want to be able to see what is happening when a shutdown does
not work, you can enable the systemd debug shell. This is a console
session on Ctrl-Alt-F9 that is started very early in the boot process
and stopped very late during shutdown. It is a root login that does
not require you to actually log in as the login code is not available
when it is started, so it is a huge security hole when enabled:

sudo systemctl enable debug-shell.service

or put this on the kernel command line:

systemd.debug-shell=1

Then make the bad shutdown happen and go to Ctrl-Alt-F9 and see if it
is still running. If it is, you can do commands like:

systemctl list-jobs

to see what is still running and holding up the shutdown. You can
then try giving kill -9 commands to things or unmounting things to see
if the shutdown will then complete.

If the Ctrl-Alt-F9 session was able to be used, then it is very likely
that the system would eventually shut down - but it could take a very
long time (> 20 minutes), as it is likely going to be waiting on a
series of very long timeouts.

Do not forget to disable the debug shell when you have finished using
it:

sudo systemctl disable debug-shell.service

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: New install Xubuntu 20.04 [ In reply to ]
On 11/07/21 4:04 pm, Stephen Worthington wrote:
> On Sun, 11 Jul 2021 14:54:52 +1200, you wrote:
>
>> It seems I spoke too soon.
>>
>> If I let the mythwelcome screen time out when idle (300 secs) the system
>> shutsdown and freezes on the splash screen.
>>
>> btw. I ran the mythtv-systemctl-helper commands from the terminal and
>> there was no prompt for a password and they worked fine.
>>
>> I'm not too fussed about it - my current system has run 16.04 fine since
>> 2017 with no mythtv-systemctl-helper script.
>>
>> I don't believe it has anything to do with Mythwelcome - as I said
>> previously,it was doing this lock up before I enabled Mythwelcome when
>> the BE idle timeout shut the system down.
>>
>> I use MythTV Control Panel to set up the system , maybe that has
>> something to do with it.
> I would doubt that. MCC just does the same things as you would have
> to do manually without it.
>
>> -Paul

> If you want to be able to see what is happening when a shutdown does
> not work, you can enable the systemd debug shell. This is a console
> session on Ctrl-Alt-F9 that is started very early in the boot process
> and stopped very late during shutdown. It is a root login that does
> not require you to actually log in as the login code is not available
> when it is started, so it is a huge security hole when enabled:
>
> sudo systemctl enable debug-shell.service
>
> or put this on the kernel command line:
>
> systemd.debug-shell=1
>
> Then make the bad shutdown happen and go to Ctrl-Alt-F9 and see if it
> is still running. If it is, you can do commands like:
>
> systemctl list-jobs
>
> to see what is still running and holding up the shutdown. You can
> then try giving kill -9 commands to things or unmounting things to see
> if the shutdown will then complete.
>
> If the Ctrl-Alt-F9 session was able to be used, then it is very likely
> that the system would eventually shut down - but it could take a very
> long time (> 20 minutes), as it is likely going to be waiting on a
> series of very long timeouts.
>
> Do not forget to disable the debug shell when you have finished using
> it:
>
> sudo systemctl disable debug-shell.service
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/


I doubt this will work  unless it logs events to a log file up to the
point it freezes.

When the system freezes it is completely locked. Alt + SysRq REISUB does
not work   , no keyboard interactions work (wired or wireless USB
keyboards.)

I haven't tried a PS2 type keyboard.

Timing-wise the lock-up happens within a second of the normal period a
shutdown requires , so the shutdown is at the brink of a successful
completion when it locks up.

 What is the actual problem that the shutdown bug your script
addresses? I know there are mythbackend thread(s) that aren't
terminated, but what is the result of that?

-paul

-



_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: New install Xubuntu 20.04 [ In reply to ]
On Sun, 11 Jul 2021 17:11:19 +1200, you wrote:

>I doubt this will work  unless it logs events to a log file up to the
>point it freezes.
>
>When the system freezes it is completely locked. Alt + SysRq REISUB does
>not work   , no keyboard interactions work (wired or wireless USB
>keyboards.)
>
>I haven't tried a PS2 type keyboard.
>
>Timing-wise the lock-up happens within a second of the normal period a
>shutdown requires , so the shutdown is at the brink of a successful
>completion when it locks up.

A complete lockup like that is most likely to be a graphics driver bug
- or at least that is what it was for me on several occasions over the
years. So if there is a later Nvidia driver in the PPA that you could
try, that might help. I found that moving to the PPA drivers meant
that I got fixed drivers at least 6 months earlier than in the
standard repositories. For a while after I installed my Nvidia GT
1030 and installed the later drivers for it, I was getting occasional
lockups like that on exit from playback of a recording or video, as
well as at times on shutdown. After I went to the PPA, the frequency
of the lockups reduced substantially on one driver update, and then
went away completely two or three updates later.

>  What is the actual problem that the shutdown bug your script
>addresses? I know there are mythbackend thread(s) that aren't
>terminated, but what is the result of that?
>
>-paul

My shutdown commands fix was for two things - firstly, the old default
settings did not work with systemd, and secondly, you needed to do
sudo and a password to get the shutdown to start. My fix changes the
commands to systemd ones and uses sudoers to make them work without a
password. The mythbackendstop.sh fix is the one for the problem with
one thread of mythbackend still keeping on running when an external
shutdown request is done. My killm script is the equivalent for
mythfrontend - the bug is in all MythTV programs, so it may be a QT
bug or something in the MythTV common code.

In MythTV v31 (also maybe v30?) the defaults for the shutdown commands
have been changed and may now work properly anyway. I do not know
what they are as they do not overwrite existing settings when you
upgrade - I suspect that you only get them on new installs, so a new
install into a virtual PC might be the only way to find out what they
are.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: New install Xubuntu 20.04 [ In reply to ]
On 11/07/21 6:56 pm, Stephen Worthington wrote:
> On Sun, 11 Jul 2021 17:11:19 +1200, you wrote:
>
>> I doubt this will work  unless it logs events to a log file up to the
>> point it freezes.
>>
>> When the system freezes it is completely locked. Alt + SysRq REISUB does
>> not work   , no keyboard interactions work (wired or wireless USB
>> keyboards.)
>>
>> I haven't tried a PS2 type keyboard.
>>
>> Timing-wise the lock-up happens within a second of the normal period a
>> shutdown requires , so the shutdown is at the brink of a successful
>> completion when it locks up.
> A complete lockup like that is most likely to be a graphics driver bug
> - or at least that is what it was for me on several occasions over the
> years. So if there is a later Nvidia driver in the PPA that you could
> try, that might help. I found that moving to the PPA drivers meant
> that I got fixed drivers at least 6 months earlier than in the
> standard repositories. For a while after I installed my Nvidia GT
> 1030 and installed the later drivers for it, I was getting occasional
> lockups like that on exit from playback of a recording or video, as
> well as at times on shutdown. After I went to the PPA, the frequency
> of the lockups reduced substantially on one driver update, and then
> went away completely two or three updates later.
>
>>  What is the actual problem that the shutdown bug your script
>> addresses? I know there are mythbackend thread(s) that aren't
>> terminated, but what is the result of that?
>>
>> -paul
> My shutdown commands fix was for two things - firstly, the old default
> settings did not work with systemd, and secondly, you needed to do
> sudo and a password to get the shutdown to start. My fix changes the
> commands to systemd ones and uses sudoers to make them work without a
> password. The mythbackendstop.sh fix is the one for the problem with
> one thread of mythbackend still keeping on running when an external
> shutdown request is done. My killm script is the equivalent for
> mythfrontend - the bug is in all MythTV programs, so it may be a QT
> bug or something in the MythTV common code.
>
> In MythTV v31 (also maybe v30?) the defaults for the shutdown commands
> have been changed and may now work properly anyway. I do not know
> what they are as they do not overwrite existing settings when you
> upgrade - I suspect that you only get them on new installs, so a new
> install into a virtual PC might be the only way to find out what they
> are.
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/

OK - I'll look at the video driver .I'm not sure if I'm using nouveau or
the Nvidia. (I think Nvidia)

The 16.04 system is using Nvidia.

It's strange that the lock up happens only on an idle time-out shutdown
and it happens every time.

sudo /home/mythtv/bin/mythtv-systemctl-helper.sh reboot  ,  halt ,
start  , poweroff  ,  stop

All work without problem from the command line.

In myth frontend  the  shutdown and reboot options in the exit menu work
fine too.

This is a fresh install of 20.04

The server halt command in use is:  sudo sh -c "mythshutdown
--shutdown"       I believe that is the default - I don't recall
changing it ,except to: mythtv-systemctl-helper.sh halt

The default shutdown and reboot settings in myth frontend are:
/bin/systemctl poweroff and /bin/systemctl reboot

Cheers

-Paul




_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/