<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 8, 2019 at 8:54 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, 8 Mar 2019 07:17:37 -0800, you wrote:<br>
<br>
>On Fri, Mar 8, 2019 at 3:16 AM Stephen Worthington <<a href="mailto:stephen_agent@jsw.gen.nz" target="_blank">stephen_agent@jsw.gen.nz</a>><br>
>wrote:<br>
><br>
>> On Thu, 7 Mar 2019 22:45:16 -0800, you wrote:<br>
>><br>
>> >I upgraded from Mythbuntu8 to mythbuntu18. X just froze and we used to use<br>
>> >CTRL-ALT-BS but I know it has been removed.<br>
>> ><br>
>> >I have been Googling this and found that this was replaced by<br>
>> >AysRq-rightAlt-K but that doesn't work. Then I found a nice gui checkbox<br>
>> >that restored it but that isn't there.  I found several different files I<br>
>> >could create, all different, and the instructions below that look like<br>
>> they<br>
>> >might work but I don't want to blow up the system so can someone tell me<br>
>> if<br>
>> >this is correct for Mythbuntu 18? (I modified it slightly to use nano).<br>
>> >Basically I found almost a dozen ways to enable this in xfce but they were<br>
>> >all different.  In the past very bad things happened when I just followed<br>
>> >online instructions.  That is why I am asking for help<br>
>> ><br>
>> >Thanks,<br>
>> ><br>
>> >Allen<br>
>> ><br>
>> >Enable the key combination Ctrl+Alt+Backspace<br>
>> ><br>
>> >   1.<br>
>> ><br>
>> >   Open the Terminal and run sudo nano /etc/default/keyboard<br>
>> >   2.<br>
>> ><br>
>> >   Find the line:<br>
>> >   XKBOPTIONS=""<br>
>> >   3.<br>
>> ><br>
>> >   Replace it with:<br>
>> >   XKBOPTIONS="terminate:ctrl_alt_bksp"<br>
>> >   4.<br>
>> ><br>
>> >   Save the modified file and close it.<br>
>> >   5.<br>
>> ><br>
>> >   Reboot your computer to take affect.<br>
>><br>
>> If you are using lightdm (as I do with Xubuntu 18), then log in from a<br>
>> terminal (Alt-F1) or ssh and do "sudo systemctl restart lightdm" to<br>
>> restart X.  That works pretty well for me, so I did not investigate<br>
>> any further the various keystroke options.<br>
>><br>
>> Thank you for the suggestion but it doesn't solve the problem.<br>
><br>
>While the lightdm command worked on a test this morning, the system was not<br>
>hung up so not sure if it would have worked last night.<br>
><br>
>The issue last night was that Myth was frozen and the cursor was off.  In<br>
>spite of no cursor, I was able to open system logoff command and click<br>
>Logoff but Myth would not close and prevented X from closing.  The logoff<br>
>attempt was met with a message "Myth is not responding do you want force a<br>
>close, Y/N" or something like that but it did not respond to a "Y" from the<br>
>keyboard so I was unable to logoff and had to use the power button.  The<br>
>power button did not fully turn off the computer and I had to do a long<br>
>press to force the computer to shut off.  Basically a hot mess. With<br>
>Mythbuntu-8 this would happen one or two times a year and the simple key<br>
>sequence would restart X and all was good.  My wife could do it without<br>
>calling me down to issue some system commands.<br>
<br>
That sounds like just a mythfrontend lockup, rather than X locking up<br>
completely.  If you already have a window running a terminal in the<br>
background when it happens, you should be able to just do Alt-Tab as<br>
many times as necessary to get to that terminal.  Then from there do:<br>
<br>
ps -e | grep mythfrontend<br>
<br>
to find the PID for mythfrontend (or mythfrontend.real if it is<br>
Ubuntu).  Then kill that process:<br>
<br>
sudo kill <pid><br>
<br>
You usually need to do that command twice to actually kill<br>
mythfrontend.  Or if mythfrontend is completely locked up, then you<br>
may need to use:<br>
<br>
sudo kill -9 <pid><br>
<br>
If you are running the XFCE desktop (Xubuntu), then you should also be<br>
able to do Ctrl-Esc to bring up a menu where you can run a terminal<br>
window from, or Ctrl-Alt-T to open a terminal window.  Or you can use<br>
Ctrl-Alt-F1 to open a terminal directly in full screen mode.<br>
<br>
WARNING: After a bad shutdown like using the power off button or after<br>
a power failure, you need to check all your filesystems on all<br>
partitions - there is a reasonable chance that any filesystem that had<br>
a write in progress at the time of the shutdown will be corrupt<br>
somewhere.  The fsck checks done automatically at boot time will<br>
likely not find and fix such corruption.  You must a full "fsck -C -f<br>
/dev/<partition id>" on all partitions that were mounted at the time,<br>
and then that should fix any errors.  If you see any errors that<br>
needed fixing, then run the command again on that partition as many<br>
times as necessary until it runs without any errors to be fixed.<br>
Failing to do this allows the corruption of the filesystem to remain<br>
in place, and if any writes take place to corrupt files or corrupt<br>
filesystem tables, then the corruption will likely spread and make the<br>
partition unusable and unfixable - you can lose your entire system.<br>
<br>
You can do fsck repairs like this by booting from a live DVD or live<br>
USB, or from another bootable partition that has the same or later<br>
version of the filesystem drivers and fsck programs.  I do this by<br>
having a second bootable partition on my SSD, which has a script to do<br>
all the fsck commands.  Booting from the normal boot partition in<br>
repair mode is not able to do an fsck on the boot partition itself,<br>
but can be used once the boot partition has been fixed to run fsck on<br>
all the other partitions.<br>
<br>
After you have clean filesystems, you then need to do a full check and<br>
repair on the mythconverg database.  If it was being written to at the<br>
time of the bad shutdown, any tables that were being modified at the<br>
time may be crashed.  If a recording was in progress, typically the<br>
recordedseek table will be crashed.  Unfortunately, when mythbackend<br>
tries to record and it then writes to recordedseek, if the table is<br>
crashed, all you get is some error messages in the mythbackend.log<br>
file.  It appears that mythbackend is recording happily, when all the<br>
time the writes to recordedseek are failing.  This does not stop a<br>
recording from succeeding, but on playback there will be problems.  It<br>
is possible to fix recordedseek, then use the "mythcommflag --rebuild"<br>
command to add the correct recordedseek table entries for a recording<br>
where this happens, but it is much better to fix the database before<br>
that.  And if any table other than recordedseek is crashed, the<br>
consequences are usually worse - if you write to other crashed tables,<br>
you can corrupt the table completely to where it is unrepairable, and<br>
that can mean you lose the entire database.  Fortunately, crashes of<br>
other tables are rare.  To check and repair the database, run the<br>
optimize_mythdb script.  It is here in Ubuntu:<br>
<br>
/usr/share/doc/mythtv-backend/contrib/maintenance/<a href="http://optimize_mythdb.pl" rel="noreferrer" target="_blank">optimize_mythdb.pl</a><br>
<br>
That script should also be being run from /etc/cron.daily to prevent<br>
any problems with database corruption.  Database corruption does<br>
happen occasionally due to minor software bugs, and unless you are<br>
running optimize_mythdb regularly to fix that corruption, it can and<br>
usually will spread and eat your database.<br>
<br>
>Even if that worked, CTRL-ALT-Backspace is a lot easier to use.  By the<br>
>way, Alt-F1 does not bring up a terminal window on my system for some<br>
>reason.<br>
<br>
Sorry, I mis-typed that.  It is Ctrl-Alt-F1 for a terminal.<br>
<br>
>What I need is something like CTRL-ALT-Backspace, or the SysRq-Alt-K (which<br>
>did not work) so that my wife can restart X.  While I appreciate knowing<br>
>about the systemctl command, it is not "wife friendly" at least in the case<br>
>of my wife. The power button would be an option but it interrupts<br>
>recordings and even it didn't really work last night,  I needed the long<br>
>press.<br>
<br>
The power button is not a good option at all, due to the possible loss<br>
of files, whole partitions, the database, or the entire system.  It<br>
should only be used as a last resort, and must be followed by the full<br>
check and fix procedure as above.<br>
<br>
>Allen</blockquote><div><br></div><div>Funny (sort of).  If you read the reason that CTRL-ALT-Backspace was removed it said that most users use the power button.  I believe the power button is set to just close Linux in a  nice controlled way.  Pressing and holding the button like I did last night is like a power off and I only did that when I was positive the system was quiet and hung up.</div><div><br></div><div>That said, I did flip the breaker and that clearly did a power off. It was a comedy of errors that caused this. I accidently put my stove into Self Clean and I could not stop it so flipped the breaker for what I thought was the stove but was actually the upstairs power distribution panel which also feeds Myth to get it on the same power as the projector.  Anyway, now I am concerned about my filesystem.</div><div><br></div><div>I have one drive, sdb1 so I am assuming that is what I need to check. Not sure if I have a bootable DVD but I am sure I need to leave now so will try and figure it out when I return.</div><div><br></div><div>Allen</div></div></div>