LinHES Forums
http://forums.linhes.org/

R5E50 Upgrade hints and hazards
http://forums.linhes.org/viewtopic.php?f=3&t=13108
Page 4 of 5

Author:  tjc [ Sun Jan 28, 2007 2:29 pm ]
Post subject: 

Bodger wrote:
I took the primary fix as spoken here, and not followed the start stop daemon thingy as the part about removing the if block does not make sense.

It makes perfect sense if you understand what is happening in that script.

1) The enclosing if statement is redundant. The whole point of using start-stop-daemon is make sure that the daemon is not already running and then start it in such a way that there isn't a race condition with two or more sttempts to start it at once. It uses techniques that are far more robust than what you can generally do with a shell script.

2) The enclosing if statement is fundamantally broken. The orignal would see a stale file from a previous boot and be fooled by the same PID being used by another program. Even with interpohl's patch I can think of at least 2-3 ways it can be fooled without trying very hard. Better to let start-stop-daemon do the job it was designed for.

Go look at some of the other init scripts like /etc/init.d/ssh or /etc/init.d/openbsd-inetd or /etc/init.d/ntp or /etc/init.d/nfs-kernel-server and you'll see that this is normal way of doing things.

BTW - For reference here is the complete script with the fix in place.
Code:
root@black2:~# more /etc/init.d/mythtv-backend
#! /bin/sh
### BEGIN INIT INFO
# Provides:          mythtv-backend
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     24
# Default-Stop:      S
# Short-Description: Start/Stop the MythTV server.
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/mythbackend
NAME="mythbackend"
DESC="MythTV server"

test -x $DAEMON || exit 0

set -e

USER=mythtv
RUNDIR=/var/run/mythtv
ARGS="--daemon --logfile /var/log/mythtv/mythbackend.log --pidfile $RUNDIR/$NAME.pid"
EXTRA_ARGS=""
NICE=0

if [ -f /etc/default/mythtv-backend ]; then
  . /etc/default/mythtv-backend
fi

ARGS="$ARGS $EXTRA_ARGS"

mkdir -p $RUNDIR
chown -R $USER $RUNDIR

case "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
        start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
                --chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME "
        start-stop-daemon --stop --oknodo --pidfile $RUNDIR/$NAME.pid \
                --chuid $USER --exec $DAEMON -- $ARGS
        test -e $RUNDIR/$NAME.pid && rm $RUNDIR/$NAME.pid
        echo "."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: $NAME"
        start-stop-daemon --stop --oknodo --pidfile $RUNDIR/$NAME.pid \
                --chuid $USER --exec $DAEMON -- $ARGS
        echo "."
        sleep 3
        start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
                --chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
        echo "."
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0


Bodger wrote:
How can I ...

I guess it's time to repeat this request again.
tjc wrote:
OBTW - As Cecil said in the R5D1 thread:
cesman wrote:
Let's not turn this into my upgrade didn't work thread.

In pursuit of that goal, I will not answer questions in this thread which do not involved an update/correction/clarification/additional information/... on the upgrade hints posting, and would request that others do the same. I'll be more than happy to give your question the attention it's due _elsewhere_, but please start or follow up on an appropriate thread for that.

Author:  mihanson [ Tue Jan 30, 2007 6:28 pm ]
Post subject: 

I just upgraded my main FE/BE machine to R5E50 this morning and I had a few issues that I'd like to report on. First, I would recommend that you not restore any apache config files from your savedfiles.tar.bz2 as the apache version has changed from R5D1. A few things that I had on my restore.list that seemed to mess up my apache/mythweb install were
Code:
./var/www/htdigest
./usr/share/mythtv/mythweb/.htaccess
./etc/apache/httpd.conf
./etc/mythtv/mythweb-htaccess.conf


I also had a problem with the backend not starting properly after I had rebooted for the first time. I performed the start-stop daemon fix, but for some reason my recordings page was still coming up empty. It turns out that my /myth partition was not mounting properly. It's a LVM volume formatted with jfs. I re-ran the recreate_lvm.sh script, but it still was not mounting. Odd. I did some googling for ideas and tried a fsck on /dev/vg/myth. First I had to install jfsutils.
Code:
# apt-get update
# apt-get install jfsutils

After that a quick
Code:
# fsck -f /dev/vg/myth
# mount -a

seems to have solved my problems.

Hope this helps someone else.

Author:  mihanson [ Thu Feb 01, 2007 9:29 pm ]
Post subject:  Re: StreamTV fixes

phmoore511 wrote:
Changed the following in the /var/www/mythweb/modules/streamtv/tmpl/default/createfile.php:
    All occurances of "<form action="<?php echo root; ?>/streamtv/" action="get">" to "<form action="<?php echo root; ?>streamtv/" action="get">". (lines 19,91,109)
    (it was causing in a double / in the url, this can probably be modified somewhere else, this was just the first place I ran across it.)

    Modified the line containing "my.host.com" to reflect my correct hostname. (line 37)
Changed the following in /var/www/mythweb/modules/streamtv/tmpl/default/confirm.php:
    Removed the leading "/" from "/streamtv/createfile". (line12)
    (again, causing a double / in the url, once again confirming I probably need to look for the variable that is setting the base url and modify it there.)

    **Edit - there are numerous files that have a mixture of references to the "streamtv" path that may or may not be correct. These edits are just a partial list to get it functional.

I managed to find a few more occurances of /streamtv/ in the following places:

Code:
/var/www/mythweb/modules/streamtv/tmpl/default/confirm.php
/var/www/mythweb/modules/streamtv/tmpl/default/createfile.php
/var/www/mythweb/modules/streamtv/tmpl/default/menu.php


If you use pico or nano text editor, just Ctrl-W and search on /streamtv/.

I also found a few instances of my.host.com in
Code:
/var/www/mythweb/modules/streamtv/tmpl/default/createfile.php


Thanks for getting us going in the right direction on this!

Author:  tjc [ Mon Feb 12, 2007 9:21 pm ]
Post subject: 

If you are having problems with MythStream audio output see Martain's (very well written) posting here: http://mysettopbox.tv/phpBB2/viewtopic.php?t=14148

Author:  mk500 [ Tue Feb 13, 2007 7:37 pm ]
Post subject: 

I finally figured out why I haven't been able to get my VFD display to work for the last few releases (including R5E50):

The fix for this is to change the following line in /etc/LCDd.conf

Code:
DriverPath=server/drivers/
  to this:
DriverPath=/usr/lib/lcdproc/


I never had problems editing the LCDd.conf file for the specifics of my VFD display, but I didn't know that I needed to tell it where the .so files are located (sometimes the obvious eludes me).

Author:  Martian [ Thu Feb 15, 2007 11:38 am ]
Post subject: 

MrFahrenheit has posted directions on how to fix the audio sync issues in the version of xine that shipped in R5E50.

It appears that there was a bug introduced in version 1.1.2 of xine-lib that is fixed by updating to version 1.1.4

I personally wasted many hours of my life trying to figure this out so hats off to MrFahrenheit!

Link:

http://www.mysettopbox.tv/phpBB2/viewto ... 2986#82986

Martian

Author:  cecil [ Thu Feb 15, 2007 1:41 pm ]
Post subject: 

Thanks for posting everyone!

Author:  techman83 [ Thu Feb 15, 2007 11:39 pm ]
Post subject: 

Thanks for a great release and a "drunken monkey" followable upgrade guide. I was in a fair drunken monkey state last night and all things went well!!

Specs of my box listed here:
http://mysettopbox.tv/phpBB2/viewtopic. ... highlight=

Fonts look far better and easier to read on a standard tv and no more weird blue border on the top and the left!

Author:  crasarx [ Sun Feb 18, 2007 9:41 am ]
Post subject: 

Thought I might add that I had to roll back to R5D1 because I couldn't get my PVR-350 TV output to work after upgrading to this version. Not sure if it's already been reported but I didn't see a reference to the potential '350 upgrade hazard' in this thread.

Author:  RobTheGob [ Mon Feb 19, 2007 9:05 pm ]
Post subject: 

I've been having lots of issues with R5E50.

Firstly, I've had major issues with "dropping data" when two capture cards start at the same time (IVTV driver with PVR-150's). I've played around with many settings and even moved one of the PVR-150's to a slave backend (MBE and two SBE, each a single capture card) - but the dropped data still continues. I thought that the new IVTV 0.10 drivers may help, but I'm having issues getting them to compile.

Secondly, I've had major issues every once in a while with "kblockd/0" and "kjournald" processes running away and making the machine almost unusable. During my searching - I read some discussions about problems with my IVTV 0.8.2 driver causing lockups. Perhaps this is IVTV related as well?

On top of that - the 0.20 version of XBMCMythTV seems less reliable than the older versions. I'm not sure if this is related to the server issues or not.

The previous versions of KnoppMyth that I've had installed were ultra-reliable. I'm just having serious headaches trying to make this run well for more than a day and am considering rolling back to R5D1 or R5C7.

I don't see anybody else mentioning similar issues - am I alone?

Author:  tjc [ Mon Feb 19, 2007 11:43 pm ]
Post subject: 

As I've already asked several times, if you have unresolved issues, please, post in another thread. The intent is to keep this a central reference for R5E50 fixes.
tjc wrote:
In pursuit of that goal, I will not answer questions in this thread which do not involved an update/correction/clarification/additional information/... on the upgrade hints posting, and would request that others do the same.

I'm delighted to see folks adding information and pointers like mk500's or Martian's postings above, but for the rest...
tjc wrote:
OBTW - As Cecil said in the R5D1 thread:
cesman wrote:
Let's not turn this into my upgrade didn't work thread.

It's hard enough to get folks to read through this whole thread without having it cluttered up with stuff like this.

Author:  tjc [ Sat Mar 17, 2007 11:52 am ]
Post subject:  Detecting and Purging stale capture card definitions

If you are getting errors/warnings when you try to exit mythtv-setup along the lines of "Card 0 (type) is set to start on channel 2, which does not exist.", please see this thread (and the ones it links to) on detecting and getting rid of stale capture card definitions in the DB: http://mysettopbox.tv/phpBB2/viewtopic.php?t=14597

This is a very common problem especially with upgrades from older versions, and getting people to recognize it and fix it seems inexplicably difficult. For a walk through on setting up the card definitions and other dependencies after purging the bad ones see the BlackScreenWatchingTV page on the wiki.

Thanks!

Author:  JoeF [ Sat Apr 21, 2007 5:29 pm ]
Post subject:  Re: Detecting and Purging stale capture card definitions

tjc wrote:
If you are getting errors/warnings when you try to exit mythtv-setup along the lines of "Card 0 (type) is set to start on channel 2, which does not exist.", please see this thread (and the ones it links to) on detecting and getting rid of stale capture card definitions in the DB: http://mysettopbox.tv/phpBB2/viewtopic.php?t=14597

That post doesn't seem to exist anymore. I fixed this error on my system by deleting the offending rows manually in the cardinput table.

Author:  tjc [ Sun Apr 22, 2007 3:05 pm ]
Post subject: 

Since the original thread seems to have gone missing, Here is a summary of the content

If the following commands show a cardid (especially 0) in the cardinput table which is not listed in the capturecard table you should remove all references to it:
Code:
root@black2:~# mysql mythconverg -e "select cardid, videodevice, defaultinput from capturecard"
+--------+-------------+--------------+
| cardid | videodevice | defaultinput |
+--------+-------------+--------------+
|      1 | /dev/video0 | Tuner 1      |
|      2 | /dev/video1 | Tuner 1      |
+--------+-------------+--------------+
root@black2:~# mysql mythconverg -e "select cardid, sourceid, inputname from cardinput"
+--------+----------+-----------+
| cardid | sourceid | inputname |
+--------+----------+-----------+
|      1 |        1 | Tuner 1   |
|      2 |        1 | Tuner 1   |
+--------+----------+-----------+

As far as I can tell, valid cardid and sourceid values now start from 1 rather than 0.

You can clean up the bad records as follows:
Code:
mysql mythconverg -e "delete from cardinput where cardid=0"


The same checks and changes can also be done using webmin:
    webmin -> Servers -> MySQL Database Server -> mythconverg -> capturecard
    webmin -> Servers -> MySQL Database Server -> mythconverg -> cardinput

Or your favorite mysql client.

Author:  khrusher [ Thu May 17, 2007 10:39 am ]
Post subject: 

just open VLC manually

then File (menu) -> Open Network Stream
click the HTTP/HTTPS/FTP/MMS radio button and enter the URL

I enter my mythstreamtv URL as the 'Default Stream' in
Settings -> Preferences -> Playlist.

Then, once I press 'Start Streaming", I start VLC and I'm watching

Page 4 of 5 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/