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

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

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

    jojo's blog--快樂憂傷都與你同在
    為夢想而來,為自由而生。 性情若水,風起水興,風息水止,故時而激蕩,時又清平……
    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)

    隨筆檔案

    文章分類

    文章檔案

    新聞分類

    新聞檔案

    相冊

    收藏夾

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲另类春色校园小说| 亚洲人成人一区二区三区| 亚洲一欧洲中文字幕在线| 日韩精品极品视频在线观看免费| 亚洲老妈激情一区二区三区| 九九久久国产精品免费热6| 亚洲精品国产va在线观看蜜芽| 国产精品手机在线亚洲| 国产成人免费片在线视频观看| 国产成人综合亚洲| 又色又污又黄无遮挡的免费视 | 美丽的姑娘免费观看在线播放| 午夜亚洲AV日韩AV无码大全| 全免费a级毛片免费看| 亚洲欧洲国产日韩精品| 亚洲性线免费观看视频成熟| 亚洲中文无码永久免| 国产美女a做受大片免费| 又粗又长又爽又长黄免费视频| 久99精品视频在线观看婷亚洲片国产一区一级在线 | 福利免费观看午夜体检区| 亚洲精品国产第一综合99久久| 国产免费观看黄AV片| 国产无限免费观看黄网站| 日韩亚洲Av人人夜夜澡人人爽| 麻豆国产精品免费视频| 亚洲爆乳AAA无码专区| 亚洲国产成人久久一区久久 | 精品成在人线AV无码免费看| 亚洲最大无码中文字幕| 亚洲一区二区三区免费| 久久综合九色综合97免费下载| 久久精品国产亚洲av麻豆图片 | jizzjizz亚洲| 亚洲免费精彩视频在线观看| 99久久婷婷国产综合亚洲| 国产福利电影一区二区三区,亚洲国模精品一区 | 久久精品国产亚洲AV无码偷窥| 在线a人片天堂免费观看高清 | 久视频精品免费观看99| 337p日本欧洲亚洲大胆人人 |