I got this from Josh Hand’s Technology Blog and I have added it to my own blog for archive purposes only!

The shell script

Filename

    vi jrun-myinstance

Script

    #!/bin/bash
    #
    # Startup script for JRun
    # chkconfig: 345 90 14
    # description: JRun myinstance instance service.
    #
    # Source function library.
    . /etc/rc.d/init.d/functions
    #
    case <span style="color: #0000ff;">"$1" in
    start)
    echo -n <span style="color: #0000ff;">"Starting JRun myinstance: "
    /opt/jrun4/bin/jrun -start myinstance
    echo
    ;;
    stop)
    echo -n <span style="color: #0000ff;">"Shuting down JRun myinstance: "
    /opt/jrun4/bin/jrun -stop myinstance
    echo
    ;;
    restart)
    /opt/jrun4/bin/jrun -restart myinstance
    ;;
    *)
    echo <span style="color: #0000ff;">"Usage: $0 {start|stop|restart}"
    exit 1
    esac
    exit 0

Installing the script

    cp jrun-myinstance /etc/init.d/jrun-myinstance"
    chmod 775 /etc/init.d/jrun-myinstance"
    chkconfig --add jrun-myinstance"

If you want it on the default run level

    chkconfig jrun-myinstance on"

Start the jrun

    service jrun-myinstance start
    service jrun-myinstance stop
    service jrun-myinstance restart
comments powered by Disqus