[mythtv-users] Automatically starting Myth Backend on SuSe 9.2

Andrew Chung acchung at techie.com
Fri May 6 06:33:50 UTC 2005


Has anyone gotten mythbackend to start correctly through init.d scripts on
SuSe 9.2?  I keep on getting an error that says:
 
2005-05-05 22:14:07.590 New DB connection, total: 1
2005-05-05 22:14:07.597 Unable to connect to database!
2005-05-05 22:14:07.597 Driver error was [1/2002]:
QMYSQL3: Unable to connect
Database error was: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)
 
2005-05-05 22:14:07.605 Failed to init MythContext, exiting.

 
I can't figure out what the dependency is for mythbackend to start.  This is
the script I'm using right now is a modified one from the contrib directory.
 
#!/bin/sh
### BEGIN INIT INFO
# Provides:       mythbackend
# Required-Start: $mysql $network $local_fs $remote_fs
# X-UnitedLinux-Should-Start: 
# Required-Stop: $mysql $network $local_fs $remote_fs
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Description:    MythTV Backend server
### END INIT INFO
 
# Default values to use if none are supplied in the config file.
# User who should start the mythbackend processes
MBE_USER="root"
# Directory holding the mythbackend binary
MBE_LOCATION="/usr/local/bin/"
# Name of mythbackend binary
MBE_PROG="mythbackend"
# Full path to mythbackend log file
MBE_LOGFILE="/var/log/mythbackend.log"
 
# Source config file if available
if [ -f "/etc/sysconfig/mythbackend" ]; then
  . /etc/sysconfig/mythbackend
fi
 
test -x ${MBE_LOCATION}${MBE_PROG} || exit 5
 
. /etc/rc.status
 
# First reset status of this service
rc_reset
 
#
#       See how we were called.
#
 
case "$1" in
    start)
        # Check if mythbackend is already running
        if [ ! -f /var/lock/subsys/${MBE_PROG} ] ; then
            echo -n "Starting ${MBE_PROG}: "
            # /usr/local/bin/mythbackend -d -l /some/log/file
            startproc -f -u ${MBE_USER} ${MBE_LOCATION}${MBE_PROG} -d -l
${MBE_LOGFILE}
        fi
        rc_status -v
        ;;
    stop)
        echo -n "Shutting down ${MBE_PROG}"
        killproc ${MBE_LOCATION}${MBE_PROG}        
        rc_status -v
        ;;
    restart)
        $0 stop
        $0 start
 
        rc_status
        ;;
    status)
        checkproc ${MBE_LOCATION}${MBE_PROG}
        rc_status -v
        ;;
    *)
        echo "Usage: $0 {start|stop|status|restart}"
        exit 1
        ;;
esac
rc_exit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20050505/1ce5e2ca/attachment.htm


More information about the mythtv-users mailing list