2012-09-26 20 views
-1

我目前正在評估一些WSO2服務器,其中一個是BAM 2.0(在碳4.0.1上)。
到目前爲止,在軟件包中總是包含一個daemon.sh文件,它可以用chkconfig作爲Linux守護進程安裝。Carbon 4.0.1(BAM 2.0)作爲Linux守護進程

很遺憾,在最新版本的碳中,daemon.sh丟失。
啓動腳本wso2server.sh可用於啓動服務,但不能作爲linux守護進程安裝。

chkconfig的回報:

[[email protected] ~]$ sudo chkconfig --add wso2 
service wso2 does not support chkconfig 

我在CentOS的努力此次發佈的6.2 - 64位。

試圖找到如何在文檔和論壇中安裝碳作爲Linux守護進程的描述 - 沒有成功。

謝謝。

回答

1

我爲BAM 2.0.0推出了自己的基本初始化腳本。 (以下是來自一個名爲「咣噹」的文件部分)。

#!/bin/sh 
# 
# chkconfig: 2345 80 80 
# 
BAM_HOME=/home/bam/current_bam 
BAM_DAEMON=bin/wso2server.sh 
START_OPTIONS=start 
STOP_OPTIONS=stop 

start() { 
    echo "Starting BAM... (it will take approx 2 mins.)" 
    su bam -c "cd $BAM_HOME && $BAM_DAEMON $START_OPTIONS > /dev/null 2>&1" 
    return 0 
} 

stop() { 
    echo "Stopping BAM... (it will take approx 10 secs.)" 
    su bam -c "cd $BAM_HOME && $BAM_DAEMON $STOP_OPTIONS > /dev/null 2>&1" 
    return 0 
} 

case "$1" in 
    start) 
    start 
    ;; 
    stop) 
    stop 
    ;; 
    restart) 
    stop 
    start 
    ;; 
    *) 
    echo $"Usage: $0 {start|stop|restart}" 
    exit 1 
esac 

exit $? 

然後我複製它/etc/init.d/目錄和可執行做到了。最後,我chkconfig了它。

現在我就可以開始與服務:

sudo service bam start 
+0

非常感謝你...你的腳本工作就像一個魅力... 不IST服務狀態工作的唯一的事情 - 但是這現在好了。 再次感謝您的支持對我非常有幫助! – ITILServ