Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1

    Unanswered: Start/Stop informix automatically.

    I Gurus,

    I need a script for start or stop the engine informix when start or shutdown the computer. the operative system is linux.

    Thank you for you help.

  2. #2
    Join Date
    Apr 2007
    Location
    Jundiai / SP - Brasil
    Posts
    311
    ________________________________________
    César Inacio Martins
    Jundiai / SP - Brasil
    http://www.imartins.com.br/informix - em Português
    http://www.imartins.com.br/informix - English (translated by Google).
    ________________________________________

  3. #3
    Join Date
    Jul 2009
    Posts
    37
    Well, I'm on AIX, but this should be applicable.

    First, you'll need to write 2 scripts, start_informix and stop_informix

    mine is pretty simple...

    start_informix

    <code>
    #!/bin/ksh
    #
    # Script to start the Informix Database and ISA Server.
    #
    echo "\nStarting the Informix Database .. \c"

    /usr/informix/bin/oninit

    if [ "$?" -eq "0" ]
    then
    echo "OK"
    else
    echo "FAILED"
    fi

    echo "\nStarting the ISA HTTP Server .... \c"

    /usr/informix/ISA/sbin/isactl start

    if [ "$?" -eq "0" ]
    then
    echo "OK\n"
    else
    echo "FAILED\n"
    fi
    exit 0

    </code>

    stop_informix
    <code>
    #!/bin/ksh
    #
    # Script to shutdown the Informix Server.
    #

    echo "\nShutting down Informix Server..."

    su - informix -c "/usr/informix/bin/onmode -ky"

    if [ "$?" -eq "0" ]
    then
    echo "\nInformix Server shutdown - OK"
    else
    echo "\nInformix Server shutdown - FAILED"
    fi
    </code>

    Both scripts assume that you have INFORMIXDIR set correctly. Put both scripts somewhere accessible by informix.

    Then, modify /etc/inittab to have the line...

    informix:2: once: su - informix -c "start_informix"

    and modify /etc/rc.shutdown to have the line...

    su - informix -c "stop_informix"

    (/etc/rc.shutdown may be empty before you start, this is not (that) unusual).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •