<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    jojo's blog--快樂憂傷都與你同在
    為夢想而來,為自由而生。 性情若水,風(fēng)起水興,風(fēng)息水止,故時(shí)而激蕩,時(shí)又清平……
    posts - 11,  comments - 30,  trackbacks - 0

    I’ve been working with Glassfish recently, from the system administration point of view.  First task, after getting a good build with Maven (doing it with basic rpm methods netted me a massive dependency list, including things like Firefox!), was to write an init script so that Glassfish can be integrated into the CentOS boot sequence.

    Because we might have multiple domains set up inside of Glassfish, I opted for a setup similar to the Tomcat5 init script - check the basename of $0, and use that to determine which domain to boot up.  The fiddling in start() gets around the fact that Glassfish doesn’t seem to write a PID file out where we need one.

    So, just in case anyone else needs to do this:

    #!/bin/bash
    # chkconfig: 2345 85 15
    # description: GlassFish is a Java Application Server.
    # processname: glassfish
    # pidfile: /var/run/glassfish.pid

    # source function library
    . /etc/init.d/functions

    RETVAL=0

    GLASSFISH_BIN="/var/lib/glassfish/bin"

    # Basename works with symbolic links.
    NAME="$(basename $0)"
    unset ISBOOT

    # Trim off the Sxx/Kxx prefix
    if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then
    NAME="${NAME:3}"
    ISBOOT="1"
    fi

    # Trim off the glassfish- prefix
    NAME=${NAME:10}

    # /etc/init.d/glassfish should never be called directly.
    if [ -z $NAME ]; then
    echo -n $"Cannot start Glassfish without specifying a domain."
    failure
    echo
    exit 1
    fi

    start() {

    echo -n $"Starting Glassfish V2 domain $NAME: "
    daemon --user glassfish --pidfile /var/run/glassfish-$NAME.pid "$GLASSFISH_BIN/asadmin start-domain $NAME &gt;/dev/null 2&gt;&amp;1"
    RETVAL=$?

    if [ $RETVAL -eq 0 ]; then
    PID=`ps U glassfish | grep $NAME | awk '{ print $1}'`
    echo $PID &gt; /var/run/glassfish-$NAME.pid
    touch /var/lock/subsys/glassfish-$NAME
    fi

    echo
    }


    stop() {

    echo -n $"Shutting down Glassfish V2 domain $NAME: "

    $GLASSFISH_BIN/asadmin stop-domain $NAME &gt;/dev/null 2&gt;&amp;1

    RETVAL=$?

    [ $RETVAL -eq 0 ] &amp;&amp; rm -f /var/lock/subsys/glassfish-$NAME &amp;&amp; rm -f /var/run/glassfish-$NAME &amp;&amp; success || failure

    echo

    }

    case "$1" in

    start)

    start

    ;;

    stop)

    stop
    ;;

    restart|reload)

    stop

    start

    ;;

    condrestart)

    if [ -f /var/lock/subsys/glassfish-$NAME ]; then

    stop

    start
    fi
    ;;

    status)
    status glassfish-$NAME

    RETVAL=$?
    ;;

    *)

    echo $"Usage: $0 {start|stop|restart|condrestart|status}"

    exit 1

    esac

    exit $RETVAL

    The alternative is to define a /etc/sysconfig/glassfish file, and insert a variable with the list of domains to boot, in sequence.  This is a little harder to manage automatically in Puppet, but might be a better solution if precise boot sequences are required (this method will boot in sequence based on the S numbers in the base script, and then the alphabetical ordering of the names).

    posted on 2009-06-10 14:38 Blog of JoJo 閱讀(293) 評論(0)  編輯  收藏 所屬分類: 每日一記My Script

    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿(6)

    隨筆檔案

    文章分類

    文章檔案

    新聞分類

    新聞檔案

    相冊

    收藏夾

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 99热精品在线免费观看| 亚洲日韩在线中文字幕综合 | 在线亚洲97se亚洲综合在线| 精品亚洲福利一区二区| 日韩免费一级毛片| 亚洲第一街区偷拍街拍| 18禁超污无遮挡无码免费网站国产| 亚洲伊人久久大香线蕉结合| 亚洲AV无码成人精品区在线观看| 一级做a爰片久久毛片免费陪 | 久久精品国产亚洲av麻豆小说| 人妻丰满熟妇无码区免费| 日木av无码专区亚洲av毛片| 1000部羞羞禁止免费观看视频| 亚洲理论片在线中文字幕| 一二三四视频在线观看中文版免费 | 日韩免费无码视频一区二区三区| 久久亚洲精品成人| 成人女人A级毛片免费软件| 亚洲欧美aⅴ在线资源| 国产成人无码免费视频97| 91av免费在线视频| 亚洲不卡av不卡一区二区| 91精品成人免费国产片| 久久亚洲2019中文字幕| 成人爽a毛片免费| 亚洲成无码人在线观看| 免费高清在线爱做视频| 免费又黄又爽又猛大片午夜 | 成人影片一区免费观看| 亚洲欧洲在线播放| 国产成人3p视频免费观看| 中文字幕久无码免费久久| 亚洲日韩乱码久久久久久| 四虎成人免费网站在线| 久久久WWW成人免费精品| 免费看男女下面日出水视频| 国产无遮挡又黄又爽免费网站| 亚洲精品视频在线播放| 国产又黄又爽又刺激的免费网址 | 2020因为爱你带字幕免费观看全集|