AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
Expand all | Collapse all

Add startup scripts in server server startup scripts.

  • 1.  Add startup scripts in server server startup scripts.

    Posted Tue February 26, 2013 11:01 PM

    Originally posted by: SystemAdmin


    Hi,
    We have couple of scripts and we need to add them in OS startup scripts.
    Example : agentstart.sh(needs to be start by the root user)
    nohup mqstart.sh &(needs to be start by the mqm user)

    As i know we cannot add them directly in /etc/initab file. This start up scripts need to add in /etc/rc/rc.d

    Can you please give me an idea how to add them in rc.d?

    Thanks,
    nkota


  • 2.  Re: Add startup scripts in server server startup scripts.

    Posted Wed February 27, 2013 11:49 AM

    Originally posted by: tech100


    in /etc/rc.d/rc2.d

    create links:

    ln -s /path/to/your/script/yourappstartstopscript /etc/rc.d/rc2.d/S99theapp
    ln -s /path/to/your/script/yourappstartstopscript /etc/rc.d/rc2.d/K99theapp

    where the /path/to/your/script/yourappstartstopscript is construct as follows:

    #--------------------------BEGIN---------------
    {code}
    case "$1" in
    start)

    here put your app startup commands /script
    ;;

    stop)

    here put your app stoping commands /script

    ;;

    *)
    $ECHO "Usage: $0 {start|stop}"
    exit 1
    ;;
    esac
    #--------------------------END---------------