MySql and /etc/init.d/mysql: line 122: ... error - Ubuntu

This is a discussion on MySql and /etc/init.d/mysql: line 122: ... error - Ubuntu ; Lots of evidence that this is a common problem, but upon updating packages on Ubuntu servers and therre was an MySqlo update I got the /etc/init.d/mysql: line 122: /etc/mysql/debian-start: No such file or directory .... error and would hang the ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: MySql and /etc/init.d/mysql: line 122: ... error

  1. MySql and /etc/init.d/mysql: line 122: ... error

    Lots of evidence that this is a common problem, but upon updating
    packages on Ubuntu servers and therre was an MySqlo update I got the


    /etc/init.d/mysql: line 122: /etc/mysql/debian-start: No such file or
    directory
    ....


    error and would hang the script. All the forums posted to change the
    bind address then reconfigure

    sudo dpkg --configure -a

    but always the script will hang, or upon restarting the server...

    sudo /etc/init.d/mysql restart

    at the same point. Funny thing was that the server was running even when
    script bombed. I can access both on the server and from network clients
    but the warnings about the server not successfully configured worried
    me. I am new to the "Debian" way but a little digging I have confirmed
    that no there was no /etc/mysql/debian-start file. All I did was make a
    dummy file:

    sudo cp /dev/null /etc/mysql/debian-start
    sudo chmod +x /etc/mysql/debian-start

    and now

    sudo dpkg --configure -a

    runs without a hitch and so does manually restarting MySql. So it seems
    to be a fix, but may question is if my little hack will cause me
    problems down the road?


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com

  2. Re: MySql and /etc/init.d/mysql: line 122: ... error

    try to debug this and run

    /bin/sh -x /etc/init.d/mysql restart

    and see where it gets stuck.

    i

  3. Re: MySql and /etc/init.d/mysql: line 122: ... error

    Ignoramus17370 wrote:
    > try to debug this and run
    >
    > /bin/sh -x /etc/init.d/mysql restart
    >
    > and see where it gets stuck.
    >

    Thanks for the tip I did not know about the debugging mechanism, but now
    I have no error since I created the dummy script
    /etc/mysql/debian-start. My question was if my hack of creating the
    dummy script /etc/mysql/debian-start cause me problems later down the road.




    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com

  4. Re: MySql and /etc/init.d/mysql: line 122: ... error

    On 2008-03-28, Jonathan N. Little wrote:
    > Ignoramus17370 wrote:
    >> try to debug this and run
    >>
    >> /bin/sh -x /etc/init.d/mysql restart
    >>
    >> and see where it gets stuck.
    >>

    > Thanks for the tip I did not know about the debugging mechanism, but now
    > I have no error since I created the dummy script
    > /etc/mysql/debian-start. My question was if my hack of creating the
    > dummy script /etc/mysql/debian-start cause me problems later down the road.


    I think that the answer is yes. It will create problems. debian-start
    is doing (for me):

    upgrade_system_tables_if_necessary;
    check_root_accounts;
    check_for_crashed_tables;

    if you do not check for crashed tables, your stuff may not run
    properly and your queries may bomb with error message "corrupt
    tables".

    i

  5. Re: MySql and /etc/init.d/mysql: line 122: ... error

    Ignoramus17370 wrote:

    > I think that the answer is yes. It will create problems. debian-start
    > is doing (for me):
    >
    > upgrade_system_tables_if_necessary;
    > check_root_accounts;
    > check_for_crashed_tables;
    >
    > if you do not check for crashed tables, your stuff may not run
    > properly and your queries may bomb with error message "corrupt
    > tables".


    Is there a template for this script? Can you directly to info on
    creating this script or either post and example?


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com

  6. Re: MySql and /etc/init.d/mysql: line 122: ... error

    Jonathan N. Little wrote:

    > Is there a template for this script? Can you directly to info on
    > creating this script or either post and example?
    >
    >


    A little more digging and I found the default script. Strange thing is
    this script is supposed to be in the package. I wonder why it was
    missing on my servers?


    #!/bin/bash
    #
    # This script is executed by "/etc/init.d/mysql" on every (re)start.
    #
    # Changes to this file will be preserved when updating the Debian package.
    #

    source /usr/share/mysql/debian-start.inc.sh

    MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
    MYUPGRADE="/usr/bin/mysql_upgrade
    --defaults-extra-file=/etc/mysql/debian.cnf"
    MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
    MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
    MYCHECK_PARAMS="--all-databases --fast --silent"
    MYCHECK_RCPT="root"

    # The following commands should be run when the server is up but in
    background
    # where they do not block the server start and in one shell instance so that
    # they run sequentially. They are supposed not to echo anything to stdout.
    # If you want to disable the check for crashed tables comment
    # "check_for_crashed_tables" out.
    # (There may be no output to stdout inside the background process!)
    echo "Checking for corrupt, not cleanly closed and upgrade needing tables."
    (
    upgrade_system_tables_if_necessary;
    check_for_crashed_tables;
    ) >&2 &

    exit 0


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com

  7. Re: MySql and /etc/init.d/mysql: line 122: ... error

    On 2008-03-28, Jonathan N. Little wrote:
    > Ignoramus17370 wrote:
    >
    >> I think that the answer is yes. It will create problems. debian-start
    >> is doing (for me):
    >>
    >> upgrade_system_tables_if_necessary;
    >> check_root_accounts;
    >> check_for_crashed_tables;
    >>
    >> if you do not check for crashed tables, your stuff may not run
    >> properly and your queries may bomb with error message "corrupt
    >> tables".

    >
    > Is there a template for this script? Can you directly to info on
    > creating this script or either post and example?
    >
    >


    I think that I know what was wrong with your startup that was taking
    too long.

    Nothing.

    I think that the debian-start script was working properly and was
    repairing crashed tables. It was just tatking a long time and you were
    impatient (and the script did not say what it was doing).

    And then you blew it away and the symptom of taking a long time to
    start went away, but that was not a good fix.

    You should restore it and give it time to run right.

    Here's my copy of debian-start for Ubuntu Hardy (beta). Seems to be
    the same as for Gutsy.

    #!/bin/bash
    #
    # This script is executed by "/etc/init.d/mysql" on every (re)start.
    #
    # Changes to this file will be preserved when updating the Debian package.
    #

    source /usr/share/mysql/debian-start.inc.sh

    MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
    MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
    MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf"
    MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
    MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
    MYCHECK_PARAMS="--all-databases --fast --silent"
    MYCHECK_RCPT="root"

    # The following commands should be run when the server is up but in background
    # where they do not block the server start and in one shell instance so that
    # they run sequentially. They are supposed not to echo anything to stdout.
    # If you want to disable the check for crashed tables comment
    # "check_for_crashed_tables" out.
    # (There may be no output to stdout inside the background process!)
    echo "Checking for corrupt, not cleanly closed and upgrade needing tables."
    (
    upgrade_system_tables_if_necessary;
    check_root_accounts;
    check_for_crashed_tables;
    ) >&2 &

    exit 0

  8. Re: MySql and /etc/init.d/mysql: line 122: ... error

    I thought you blew it away. no?

    io
    On 2008-03-28, Jonathan N. Little wrote:
    > Jonathan N. Little wrote:
    >
    >> Is there a template for this script? Can you directly to info on
    >> creating this script or either post and example?
    >>
    >>

    >
    > A little more digging and I found the default script. Strange thing is
    > this script is supposed to be in the package. I wonder why it was
    > missing on my servers?
    >
    >
    > #!/bin/bash
    > #
    > # This script is executed by "/etc/init.d/mysql" on every (re)start.
    > #
    > # Changes to this file will be preserved when updating the Debian package.
    > #
    >
    > source /usr/share/mysql/debian-start.inc.sh
    >
    > MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
    > MYUPGRADE="/usr/bin/mysql_upgrade
    > MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
    > MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
    > MYCHECK_PARAMS="--all-databases --fast --silent"
    > MYCHECK_RCPT="root"
    >
    > # The following commands should be run when the server is up but in
    > background
    > # where they do not block the server start and in one shell instance so that
    > # they run sequentially. They are supposed not to echo anything to stdout.
    > # If you want to disable the check for crashed tables comment
    > # "check_for_crashed_tables" out.
    > # (There may be no output to stdout inside the background process!)
    > echo "Checking for corrupt, not cleanly closed and upgrade needing tables."
    > (
    > upgrade_system_tables_if_necessary;
    > check_for_crashed_tables;
    > ) >&2 &
    >
    > exit 0
    >
    >


  9. Re: MySql and /etc/init.d/mysql: line 122: ... error

    Ignoramus17370 wrote:

    > I think that I know what was wrong with your startup that was taking
    > too long.
    >
    > Nothing.
    >
    > I think that the debian-start script was working properly and was
    > repairing crashed tables. It was just tatking a long time and you were
    > impatient (and the script did not say what it was doing).


    Possible. Except this time, as usual, I ran updates on the servers via
    SSH from my XP desktop at night before I hit the hay. I'm cursed with
    dialup (broadband hasn't reached this third-world part of the US) so I
    run it over the night in order not to tie up my bandwidth. These are the
    new servers so other than a small test db there is not much to fix. I
    haven't transfered the data from my old Mandrake servers yet. So I woke
    up to find the error message in the term window after the update (one
    server was fine the other had this problem).

    Oh well, who knows. I copied the script from one server to the other and
    it works now.

    Thanks.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com

+ Reply to Thread