Adding ENVIRONMENT variables to mythfrontend

Ask for new features here.

Moderator: Pablo

Post Reply
dagnygren
Member
Posts: 20
Joined: Sun Feb 20, 2011 12:28 pm

Adding ENVIRONMENT variables to mythfrontend

Post by dagnygren » Tue Aug 14, 2012 10:18 pm

Hi!

Running ram-minimyth-0.24.3-81 version on my Zotac and seeing constant crashes like this:

Aug 15 00:03:31 zotac1 mythfrontend: ======= Backtrace: =========
Aug 15 00:03:31 zotac1 mythfrontend: /lib/libc.so.6(+0x76837)[0xb5df4837]
Aug 15 00:03:31 zotac1 mythfrontend: /lib/libc.so.6(+0x95af4)[0xb5e13af4]
Aug 15 00:03:31 zotac1 mythfrontend: /lib/libc.so.6(tzset+0x3d)[0xb5e13d9d]
Aug 15 00:03:31 zotac1 mythfrontend: /usr/lib/qt4/lib/libQtCore.so.4(_ZN5QTime11currentTimeEv+0x2d)[0xb6099a2d]
Aug 15 00:03:31 zotac1 mythfrontend: /usr/lib/qt4/lib/libQtCore.so.4(_ZN5QTime5startEv+0x1b)[0xb6099b0d]
Aug 15 00:03:31 zotac1 mythfrontend: /usr/lib/libmythdb-0.24.so.0(_ZN10MythSocket15writeStringListER11QStringList+0xb57)[0xb6fd3009]
Aug 15 00:03:31 zotac1 mythfrontend: /usr/lib/libmythdb-0.24.so.0(_ZN10RemoteFile4ReadEPvi+0x607)[0xb700d4c1]
Aug 15 00:03:31 zotac1 mythfrontend: /usr/lib/libmythtv-0.24.so.0(_ZN10RingBuffer9safe_readEP10RemoteFilePvj+0x3e)[0xb719d6a0]
Aug 15 00:03:31 zotac1 mythfrontend: /usr/lib/libmythtv-0.24.so.0(_ZN10RingBuffer3runEv+0x11e8)[0xb71a17d0]

Found a soulmate on the net that made a workaroung ny setting MALLOC_CHECK_=1 before starting mythfrontend. (http://code.mythtv.org/trac/ticket/10201)
Could we please get a config var where we can set arbitrary environment variables for minimyth? (Or can it already be done?)

Best
Dag

m_theredhead
Contributor
Posts: 170
Joined: Thu Apr 27, 2006 7:00 pm
Location: Arizona

Re: Adding ENVIRONMENT variables to mythfrontend

Post by m_theredhead » Wed Aug 15, 2012 8:30 pm

Just to test, you could add something like this to your minimyth.pm

rename "/usr/bin/mythfrontend","/usr/bin/mythfrontend.real";
open (MF, ">/usr/bin/mythfrontend");
print MF << 'NEWMF';
#!/bin/bash
export MALLOC_CHECK_=1
exec /usr/bin/mythfrontend.real
NEWMF
close MF;
chmod (0755,"/usr/bin/mythfrontend");

Michael

dagnygren
Member
Posts: 20
Joined: Sun Feb 20, 2011 12:28 pm

Re: Adding ENVIRONMENT variables to mythfrontend

Post by dagnygren » Wed Aug 15, 2012 8:38 pm

Yes, I know, but it needs a lot of work to do change the rootfs file for this and it will disappear during the next update.
Also need to figure out the make command to recreate the squashfs again...

Looking at the bug report for this particular bug I really don't expect it to be fixed very soon.

Thanks anyway!

m_theredhead
Contributor
Posts: 170
Joined: Thu Apr 27, 2006 7:00 pm
Location: Arizona

Re: Adding ENVIRONMENT variables to mythfrontend

Post by m_theredhead » Wed Aug 15, 2012 9:55 pm

I am not sure I understand your comment below.

In your minimyth.conf, set:

MM_MINIMYTH_FETCH_MINIMYTH_PM=yes

Then in your tftp directory for minimyth create the minimyth.pm file.

Then the file is downloaded at boot up. You don't have to modify any ram filesystems or squashfs.

It should look something llke:


################################################################################
# minimyth.pm
#
# The optional MiniMyth configuration package.
#
# For information on this file, see either
# <http://minimyth.org/document.shtml>
# or
# <http://{minimyth}/document.shtml>,
# where '{minimyth}' is the IPv4 address or hostname of your MiniMyth minimyth.
#
# A the time package is called, very little configuration has beeen completed.
# While kernel modules loaded by udev have been loaded, kernel modules loaded by
# other methods are not. In addition, very few services have been started.
# Finally, name resolution (i.e. DNS) has not been configured. As a result, you
# need to be careful about what you assume is available. In particular, you
# must use IP addresses rather than DNS names when refering to servers.
################################################################################
package init::minimyth;

use strict;
use warnings;

use MiniMyth ();

sub start
{
my $self = shift;
my $minimyth = shift;

rename "/usr/bin/mythfrontend","/usr/bin/mythfrontend.real";
open (MF, ">/usr/bin/mythfrontend");
print MF << 'NEWMF';
#!/bin/bash
export MALLOC_CHECK_=1
exec /usr/bin/mythfrontend.real
NEWMF
close MF;
chmod (0755,"/usr/bin/mythfrontend");

return 1;
}


sub stop
{
my $self = shift;
my $minimyth = shift;

return 1;
}

1;


Don't delete the 1; above. It needs to be in the file

Michael

dagnygren
Member
Posts: 20
Joined: Sun Feb 20, 2011 12:28 pm

Re: Adding ENVIRONMENT variables to mythfrontend

Post by dagnygren » Thu Aug 16, 2012 4:45 pm

Thanks!

I didn't realize we already had a hook here. Should read the documentation more carefully I guess...

Thanks again!

Figueroasre
New Member
Posts: 3
Joined: Sat Nov 17, 2012 8:00 am

Re: Adding ENVIRONMENT variables to mythfrontend

Post by Figueroasre » Sat Nov 17, 2012 9:54 am

Yes, I know, but it needs a lot of work to do change the rootfs file for this and it will disappear during the next update.
Homeland Season 1 DVD says hello to all of TV fans!

Post Reply