View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 1 post ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Tue Nov 17, 2020 11:12 am 
Offline
Joined: Sat Jan 06, 2007 7:08 pm
Posts: 125
I’ve been in the process of migrating to a new boot drive on my LinHes box, and as part of that project I started addressing one nagging issue I have had…myth_mtc. The good news is that I feel that I have identified the root cause and have temporary solution and a path forward.

I was able to successfully reproduce my issue and test the workaround on a clean installation

In my case, when mythtv_mtc ran every ten minutes, it would successfully go through the first two “if” clauses in myth_mtc, the home dir size check and the database optimize
It would then fail on the backup, falling out of the if clause.

I discovered that myth_mtc was looking at the wrong log file in that if clause.

The reason it was looking at the wrong log file goes back some time and was the result of me shooting myself in the foot a fair number of years ago. Be that as it may, other users could find themselves in this situation in the future if they use a FQDN hostname during setup, so here is what I found out…

I shot myself in the foot (possibly) during the upgrade from linhes 7’ish to the first version of 8. At the time I perhaps too carefully read the on screen warnings about naming the host, and as a result I wrongfully decided to rename my box from ‘mythtv’ to ‘mythtv.local’. That caused issues with previously recorded programs, which I corrected by updating the database entries from ‘mythtv’ to mythtv.local’ at the time.

However, myth_mtc never ran.

Looking at the scripts and configuration, I see that the myth_mtc script is using /usr/bin/logger to send output to the log files. It appears that log file creation and rotation is controlled by rsyslog and the configuration /etc/rsyslog.conf. When mytht_mtc creates the myth_mtc logfile, the filename is constructed using the variable $hostname, which is set by the script:

Code:
date=`date +%Y-%m-%d`
timestamp=`date +'%Y-%m-%d %H:%M'`
hostname=`hostname`
logFile="/var/log/${date}/${hostname}_myth_mtc.log"
log="logger -t myth_mtc -p local6.info”


So, In my case, ‘hostname’ is getting set to “mythtv.local’ and the log file is being set to /var/log/$DATE/mythtv.local_myth_mtc.log

The problem is that rsyslog (and in turn ‘logger’) is not using fully qualified domain names but the script myth_mtc is using a fqdn by use of the $hostname declaration.

https://wiki.archlinux.org/index.php/rsyslog

states:

Quote:
If you want to have full hostnames in logs and used to name the log files, you need to add $PreserveFQDN on

When things weren’t working, I could see a file called mythtv.local_myth_mtc.log was created by the myth_mtc script, but that log file was always empty. Log file data was being directed to mythtv_myth_mtc.log instead per the rsyslog.conf config to use non-fqdn names.

But Xymon is looking at the mythtv.local_myth_mtc.log file, which is always empty, and status goes red and idle.py is not satisfied.

As a temporary workaround, I modified the /etc/cron.hourly/myth_mtc script to return the short hostname:

Code:
hostname=`hostname —short`


And I forced the creation of a link from the log file with the fqdn hostname to the non-fqdn hostname in myth_mtc script.

Code:
ln -s $logFile /var/log/${date}/${hostname}.local_myth_mtc.log

These changes satisfied idle.py, which in turn allowed mythtv_mtc to run successfully to completion

The real solution will be for me to rename the box from mythtv.local to mythtv and undo my modifications to the mythtv_mtc script.

Based on these instructions, I see how to update the references to hostname in the database:

https://www.mythtv.org/wiki/Database_Ba ... or_backend

This does not address os level references to the hostname, so I will be doing the above, plus updating various settings that I find, such as

/etc/func/minion.conf:minion_name = mythtv.local
/etc/hostname:mythtv.local
/etc/hosts:127.0.0.1 mythtv.local localhost
/etc/samba/smb.conf: server string = mythtv.local

/home/xymon/hosts.cfg:127.0.0.1 mythtv.local # bbd func http://localhost/
/home/xymon/xymonserver.cfg:XYMONSERVERHOSTNAME="mythtv.local" # The hostname of your server


/usr/MythVantage/templates/settings/syssettings/syssettings.xml: various entries such as:
templates/settings/syssettings/syssettings.xml: <value>SGweightPerDir:mythtv.local:/data/storage/M4-CT064M4SSD2_000000001319093ABB7C/media/video</value>

_________________
DH87MC i7-4770 16GB ram Xonar Essence ST geforce 710 LinHes 8.6


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu