[mythtv-users] Database size issue exposes Perl problem; 1 fixed, 1 to go

James Miller gajs-f0el at dea.spamcon.org
Thu Oct 6 18:08:14 UTC 2016


As I was recently trying to do some things on my MythTV system (installed
under Gentoo), I realized my main hard drive (not where I store
recordings) was, to my great surprise and dismay, nearly full. A bit of
analysis revealed this had occurred because one of my Mysql directories
had grown out of all reasonable proportion and contained a not
inconsiderable number of quite large log files. Some subsequent research I
did led me to believe I'd perhaps need to run optimize_mythdb.pl, which,
when tried, revealed a perl problem. Yet further research led me to the
solution for shrinking the offending mysql directory to an acceptable size
and ensuring, it seems, that this problem will not arise again. I'll
document here the steps I took. But I'm still not quite sure what to do
about the perl problem, so I'll ask about that.

Trying to run optimize_mythdb.pl failed with a message very similar to the
one asked about in this old 2008 thread:
http://lists.mythtv.org/pipermail/mythtv-users/2008-October/236730.html,
to wit:

Can't locate MythTV.pm in @INC (you may need to install the MythTV module)
(@INC contains: /etc/perl /usr/local/lib64/perl5/5.22.2/x86_64-linux
/usr/local/lib64/perl5/5.22.2
/usr/lib64/perl5/vendor_perl/5.22.2/x86_64-linux
/usr/lib64/perl5/vendor_perl/5.22.2 /usr/local/lib64/perl5
/usr/lib64/perl5/vendor_perl /usr/lib64/perl5/5.22.2/x86_64-linux
/usr/lib64/perl5/5.22.2 .) at
/usr/share/mythtv/contrib/maintenance/optimize_mythdb.pl line 15

Except that my error output only refers to one perl version--5.22.2. But
looking around the system indicates to me that I do, in fact, have more
than one perl version on this system: 5.20.1, 5.20.2, and 5.22.2 are all
present. I assume the solution indicated in that thread could well be
applicable to my situation; problem is, I don't understand what action is
being proposed.

Can anyone clarify for me what, exactly "copy the bindings directory to
one of the paths listed in @INC" means? I suspect I will need to copy
something into some perl 5.22.2 directory, e.g, into
/usr/lib64/perl5/vendor_perl/5.22.2, which is present on this system. But
what thing/s I'm supposed to copy and into which directory/ies is not
quite clear to me. What is this "bindings" directory? The only bindings
directory I find on my system that is associated with MythTV has only a
php directory under it. Perhaps the structure/workings of MythTV have
changed since that old posting and this is why the directive advised there
is unclear? Input on accomplishing a resolution to this issue will be
appreciated.

As to the way in which I fixed the disk-space issue, I employed directives
found at http://www.gossamer-threads.com/lists/gentoo/user/211429. I
started off, as recommended, by adding the line expire_logs_days = 7 to
the [mysqld] section of /etc/mysql/my.cnf (gentoo now apparently puts this
config file in a different spot than it was in when the referenced thread
was active). This, I assume, should keep the disk-space issue I saw from
cropping up again.

I then logged into mysql (I discovered this system actually has mariadb 
installed which, as I'm understanding, is a mysql work-alike) and set the 
variable SET GLOBAL expire_logs_days=7; as directed. The final step was to 
run PURGE BINARY LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 7 DAY); which 
shrunk my hard disk's occupied space from about 55 to 20 GB (i.e., 35 GB 
of logs got deleted). Though that issue is now apparently resolved, 
additional input of any sort on this issue/solution is welcomed as well.


More information about the mythtv-users mailing list