Topic
1 reply Latest Post - ‏2013-02-27T16:49:03Z by tech100
SystemAdmin
SystemAdmin
6907 Posts
ACCEPTED ANSWER

Pinned topic Add startup scripts in server server startup scripts.

‏2013-02-27T04:01:16Z |
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
Updated on 2013-02-27T16:49:03Z at 2013-02-27T16:49:03Z by tech100
  • tech100
    tech100
    109 Posts
    ACCEPTED ANSWER

    Re: Add startup scripts in server server startup scripts.

    ‏2013-02-27T16:49:03Z  in response to SystemAdmin
    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---------------