[mythtv-users] Yes, a diff mysqld problem

Tom E. Craddock, Jr. sigtom at sigtom.com
Sat Sep 18 09:19:26 EDT 2004


Grr, shouldve waited to have sent that other email.  Sorry for another 
one so close together.....

When following Jarods guide, it says to edit /etc/init.d/mysqld and to 
look for the 2 lines that say
"`/usr/bin/mysqladmin ping 2> /dev/null`"
and change it to
"`/usr/bin/mysqladmin -umysql ping 2> /dev/null`"

Well, after looking at the mysqld, I only see one area thats close to 
the above, and even then, its only one part.  Should we just change the 
line that says

# If you've removed anonymous users, this line must be changed to
    # use a user that is allowed to ping mysqld.
    ping="/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER ping"
to
    ping="/usr/bin/mysqladmin -umysql ping"

I am using FC2, installed mythtv-suite-0.16-44.  Thanks once again in 
advanced for any help. 

Tom E. Craddock, Jr.

P.S. Attached is the mysqld I have on my machine.



-------------- next part --------------
#!/bin/bash
#
# mysqld	This shell script takes care of starting and stopping
#		the MySQL subsystem (mysqld).
#
# chkconfig: - 78 12
# description:	MySQL database server.
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld/mysqld.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network


prog="MySQL"

datadir="/var/lib/mysql"

start(){
	touch /var/log/mysqld.log
	chown mysql:mysql /var/log/mysqld.log 
	chmod 0640 /var/log/mysqld.log
	if [ ! -d $datadir/mysql ] ; then
	    action $"Initializing MySQL database: " /usr/bin/mysql_install_db
	    ret=$?
	    chown -R mysql:mysql $datadir
	    if [ $ret -ne 0 ] ; then
		return $ret;
	    fi
	fi
	chown -R mysql:mysql $datadir
	chmod 0755 $datadir
	/usr/bin/safe_mysqld  --defaults-file=/etc/my.cnf >/dev/null 2>&1 &
	ret=$?
	# If you've removed anonymous users, this line must be changed to
	# use a user that is allowed to ping mysqld.
	ping="/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER ping"
        # Spin for a maximum of ten seconds waiting for the server to come up
	if [ $ret -eq 0 ]; then
            for x in 1 2 3 4 5 6 7 8 9 10; do
            if [ -n "`$ping 2> /dev/null`" ]; then
                    break;
            else
                    sleep 1;
            fi
            done
            if !([ -n "`$ping 2> /dev/null`" ]); then
                    echo "Timeout error occurred trying to start MySQL Daemon."
                    action $"Starting $prog: " /bin/false
            else
                    action $"Starting $prog: " /bin/true
            fi
	else
    	    action $"Starting $prog: " /bin/false
	fi
	[ $ret -eq 0 ] && touch /var/lock/subsys/mysqld
	return $ret
}

stop(){
        /bin/kill `cat /var/run/mysqld/mysqld.pid  2> /dev/null ` > /dev/null 2>&1
	ret=$?
	if [ $ret -eq 0 ]; then
	    action $"Stopping $prog: " /bin/true
	else
    	    action $"Stopping $prog: " /bin/false
	fi
	[ $ret -eq 0 ] && rm -f /var/lock/subsys/mysqld
	[ $ret -eq 0 ] && rm -f $datadir/mysql.sock
	return $ret
}
 
restart(){
    stop
    start
}

condrestart(){
    [ -e /var/lock/subsys/mysqld ] && restart || :
}

# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  status)
    status mysqld
    ;;
  restart)
    restart
    ;;
  condrestart)
    condrestart
    ;;
  *)
    echo $"Usage: $0 {start|stop|status|condrestart|restart}"
    exit 1
esac

exit $?


More information about the mythtv-users mailing list