Page 1 of 1

Adding ENVIRONMENT variables to mythfrontend

Posted: Tue Aug 14, 2012 10:18 pm
by dagnygren
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

Re: Adding ENVIRONMENT variables to mythfrontend

Posted: Wed Aug 15, 2012 8:30 pm
by m_theredhead
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

Re: Adding ENVIRONMENT variables to mythfrontend

Posted: Wed Aug 15, 2012 8:38 pm
by dagnygren
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!

Re: Adding ENVIRONMENT variables to mythfrontend

Posted: Wed Aug 15, 2012 9:55 pm
by m_theredhead
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

Re: Adding ENVIRONMENT variables to mythfrontend

Posted: Thu Aug 16, 2012 4:45 pm
by dagnygren
Thanks!

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

Thanks again!

Re: Adding ENVIRONMENT variables to mythfrontend

Posted: Sat Nov 17, 2012 9:54 am
by Figueroasre
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.