• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

upgrade 751 -> 753 failed. MYSQL start problem

A

aheidl

Guest
upgrade 751 -> 753 failed. bug in script to stop mysql?

hello guys, i now have a problem that sounds similar to other threads, but i still cannot find a solution.

i tried to upgrade to ver 7.5.3 from ver 7.5.1 and the installation got aborted with this log:

----------

START LOGGING: Tue May 24 12:49:34 CEST 2005
Making some checks before upgrading

Now BIND server shutting down...

Trying to stop BIND server... Shutting down name server BIND 9 waiting for named to shut down ...done
done
Trying to start BIND server... Starting name server BIND 9 cp: `/etc/named.conf' and `/var/lib/named//etc/named.conf' are the same file
..done
done

BIND server starts Ok.

Trying to start MySQL server... done
Trying to establish test connection... connected
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Usage: /etc/init.d/mysql start|stop|restart
Cannot start Mysql server

ERROR while trying to check Plesk Database version

Aborting...

----------

now i cannot get the control panel up and running. the login appears but the page remains blank when logging in. just the logo and top frame is visible. I have also tried to do a manual rpm --force install of the core as well as running autoinstaller. the result is always the same.

the server is a suse 9.1 install. any help appreciated!!

thanks,

Alex
 
script error?

the more i look at the error the more i get the feeling that this is a script error in the rpms. before the core is installed several checks are run, which is where the script failes. it tries to start/stop the mysql with the incorrect command line parameters... i am not a linux guru; hence if someone knows if it is possible to modify the rpms regarding that, this would be a point to start...
 
Re: script error?

Originally posted by aheidl
the more i look at the error the more i get the feeling that this is a script error in the rpms. before the core is installed several checks are run, which is where the script failes. it tries to start/stop the mysql with the incorrect command line parameters... i am not a linux guru; hence if someone knows if it is possible to modify the rpms regarding that, this would be a point to start...

I concur, I even have the line # that I need to edit. I just dont know how to rip apart an RPM and put it back.

I guess it wouldnt kill me to learn how, if thats even possible.
 
damn you are good ;) if i can be of any help let me know, though i dont have a clue as well how to modify rpms.
 
I tried to edit the the RPM in VI. some areas you cannot edit. It corrupts the RPM

Code:
true^@start_script="/etc/init.d/mysqld"
sed -e 's|mysqladmin ping|mysqladmin -u admin -p"\\\`cat /etc/psa/.psa.shadow\\\`" ping|g' \
< "$start_script" > "$start_script.tmp" &&
mv -f "$start_script.tmp" "$start_script" &&
chmod 755 "$start_script"^@[ -x /usr/local/psa/admin/bin/packagemng ] ....

sure wish I could edit it to say
start_script="/etc/init.d/mysqld start"
 
Repacking an RPM

Well, sw-soft should immediately release an updated/fixed RPM in my opinion, since their users have pointed out their bug. Lets see how long it takes :) I'll send this in to bugreport@ and see what happens.

But, if you feel like doing more work for them (hehehe), here's some documentation on rebuilding RPMs. I use BSD (I dont have any linux systems sitting around to do this on), otherwise I would just rebuild it myself.

Hope it helps,

-J
 
]# rpm -ivv --force psa-7.5.3-rh9.build75050506.13.i586.rpm
---SNIP---
Code:
connected
+ return 0
+ sleep 1
+ mysqld_status
+ local file=/usr/local/psa/mysql/libexec/mysqld
+ test -x /usr/local/psa/mysql/libexec/mysqld
+ /etc/rc.d/init.d/mysqld status
+ sleep 1
++ expr 20 - 1
+ timeout_counter=19
+ test 19 -lt 1
+ mysqld_status
+ local file=/usr/local/psa/mysql/libexec/mysqld
+ test -x /usr/local/psa/mysql/libexec/mysqld
+ /etc/rc.d/init.d/mysqld status
+ sleep 1
++ expr 19 - 1
+ timeout_counter=18
+ test 18 -lt 1
+ mysqld_status
+ local file=/usr/local/psa/mysql/libexec/mysqld
+ test -x /usr/local/psa/mysql/libexec/mysqld
+ /etc/rc.d/init.d/mysqld status
+ sleep 1
++ expr 18 - 1
+ timeout_counter=17
+ test 17 -lt 1
+ mysqld_status
+ local file=/usr/local/psa/mysql/libexec/mysqld
+ test -x /usr/local/psa/mysql/libexec/mysqld
+ /etc/rc.d/init.d/mysqld status
+ sleep 1
++ expr 17 - 1
+ timeout_counter=16
+ test 16 -lt 1
+ mysqld_status
+ local file=/usr/local/psa/mysql/libexec/mysqld
+ test -x /usr/local/psa/mysql/libexec/mysqld
+ /etc/rc.d/init.d/mysqld status
+ sleep 1
++ expr 16 - 1
+ timeout_counter=15
+ test 15 -lt 1
+ mysqld_status
+ local file=/usr/local/psa/mysql/libexec/mysqld
+ test -x /usr/local/psa/mysql/libexec/mysqld
+ /etc/rc.d/init.d/mysqld status
+ sleep 1
++ expr 15 - 1
+ timeout_counter=14
+ test 14 -lt 1
+ mysqld_status
+ local file=/usr/local/psa/mysql/libexec/mysqld
+ test -x /usr/local/psa/mysql/libexec/mysqld
+ /etc/rc.d/init.d/mysqld status
+ sleep 1
++ expr 14 - 1
repeats like 13 more times.

no such cmd mysqld status
 
]#vi psa-7.5.3-rh9.build75050506.13.i586.rpm

looking at the mysql_status function, all it wants to do it get the losey PID for mysqld

Code:
mysqld_status()
{
    local file="$PRODUCT_ROOT_D/mysql/libexec/mysqld"
    if test -x "$file"; then
                #standard build
                get_pid "$file" false
                pid=$common_var
                if test "$pid" -ne 1; then
                        echo "$file (pid $pid) is running..." >>$product_log 2>&1
                        return 0
                else
                        echo "$file is stopped" >>$product_log 2>&1
                        return 1
                fi
        fi

    #rpm build
    $PRODUCT_RC_D/$mysql_service status >> $product_log 2>&1
}

I edited my /etc/my.cnf to assign a PID file

Code:
]# cat /var/lib/mysql/mysqld.pid
10591

changed to

Code:
mysqld_status()
{
    local file="/var/lib/mysql/mysqld.pid"
    if test -x "$file"; then
                #standard build
                get_pid "$file" false
                pid=$common_var
                if test "$pid" -ne 1; then
                        echo "$file (pid $pid) is running..." >>$product_log 2>&1
                        return 0
                else
                        echo "$file is stopped" >>$product_log 2>&1
                        return 1
                fi
        fi

    #rpm build
    cat /var/lib/mysql/mysqld.pid >> $product_log 2>&1
}

wishfull thinking. Editing an RPM just currupts it. I dont know if there is a way to make it ignore the checksums or whatever but this is what I get.


Code:
# rpm -ivvh --nomd5 --nofiles --ignorearch --nodigest --nosignature --force psa-7.5.3-rh9.build75050506.13.i586.rpm
D: ============== psa-7.5.3-rh9.build75050506.13.i586.rpm
D: Expected size:     45037375 = lead(96)+sigs(180)+pad(4)+data(45037095)
D:   Actual size:     45037359
error: psa-7.5.3-rh9.build75050506.13.i586.rpm: headerRead failed: region trailer: BAD, tag -1962409984 type 0 offset -63749369 count 1671616726
error: psa-7.5.3-rh9.build75050506.13.i586.rpm cannot be installed
D: found 0 source and 0 binary packages


So how else can I get this RPM to be able to get PID for MYSQL?
 
Back
Top