[mythtv-users] my documentation on mythtv installation

R. G. Newbury newbury at mandamus.org
Thu Jan 18 16:07:57 UTC 2018


On 2018-01-17 04:44 PM, Jim Abernathy wrote:
>>> For completeness I updated my blog on what I did to install the latest v29 on Ubuntu 16.04.  I added a section on the database maintenance and using ssmtp to send out maintenance message to my email.http://mythtvinstall.blogspot.com/2018/01/creating-combined-mythtv-headless.html  
>>

I run mythtv on Fedora not Ubuntu so some bits are different. 
Nonetheless, this is a really good step by step instruction sheet. I 
suggest that you post it into the mythtv wiki so it cannot die from bit-rot.

I have 2 comments:

1) In your first para you note that logs etc. can fill your '/' drive. 
You can avoid this by putting /var on a separate partition. If /when a 
separate /var partition fills up, *nothing bad happens*.  If /when an 
included var folder fills '/', a very *very* messy crash results. 
Recovery then requires a live image boot, as the kernel cannot write to 
its logs and generally panics.


2) You note that the HVR2250 is slow to load its firmware. It is 
actually worse than that. The three drivers have to load *in the correct 
order* for the card to work. (Due to systemd trying to do everything "in 
parallel" the actual order on any boot is not deterministic). And the 
modules have to be *unloaded* in 'top-down' order before you can re-load 
them. Been there, cursed at that..! Symptoms: the card appears flaky as 
it sometimes works, and sometimes does not. You can check the load order 
by parsing output of dmesg.)

I ended up adding the following to /etc/rc.d/rc.local

*******************
# backend must be stopped for modprobes to work
/usr/bin/systemctl stop mythbackend.service
killall mythlogserver
killall mythbackend     # just in case
# UTF encoding needed by myth if not otherwise set (locale.conf)
export LC_ALL=en_US.UTF-8

echo "options saa7164 adapter_nr=6,7" > /etc/modprobe.d/hvr2250.conf
# the nr=integers may need adjustment on your system!

# Required to install the modules in the correct order
# Cannot yank modules out of order, must yank 'top' module first
# So need to work around failed attempts: use combinations
modprobe -r tda18271
modprobe -r s5h1411
modprobe -r saa7164
modprobe -r s5h1411
modprobe -r tda18271
modprobe -r s5h1411
#echo "  Ignore FATAL error messages if next lines are empty"
lsmod | grep tda18271 # these lines just check the removal
lsmod | grep s5h1411
lsmod | grep saa7164
#echo "  No output means all of the modules were properly unloaded"
#   load in the correct order
modprobe  tda18271
modprobe  s5h1411
modprobe  saa7164
#echo "  Modules re-loaded in proper order"
systemctl start mythbackend.service

*****************

Ubuntu's systemd may or may not create a rc-local.service file. Probably 
it does, but if it does not then create a 
/etc/systemd/system/rc-local.service file containing:

*********************************
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
[Unit]
Description=/etc/rc.d/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.d/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
*************************

and chmod 755 /etc/rc.d/rc.local as noted in the service file.

Together these steps will un-load and re-load the drivers in the correct 
order and re-start the backend properly and automagically!

Geoff

-- 
              R. Geoffrey Newbury			
              954 Owenwood Drive
          Mississauga, Ontario, L5H 3J2

       t905-271-9600 newbury at mandamus.org


More information about the mythtv-users mailing list