2

我在 Ubuntu 12.04 Jboss 上启动 JBoss 7 版本 7.1.1 Final 时遇到了问题/usr/share/jboss。该脚本位于 /etc/init.d/jboss 下方。

#!/bin/bash### BEGIN INIT INFO
# Provides:          jbossas7
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/Stop JBoss AS 7
### END INIT INFO
# chkconfig: 35 92 1

## Include some script files in order to set and export environmental variables
## as well as add the appropriate executables to $PATH.
[ -r /etc/profile.d/java.sh ] && . /etc/profile.d/java.sh
[ -r /etc/profile.d/jboss.sh ] && . /etc/profile.d/jboss.sh

JBOSS_HOME=/usr/share/jboss

AS7_OPTS="$AS7_OPTS -Dorg.apache.tomcat.util.http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0=tr$
AS7_OPTS="$AS7_OPTS -Djboss.bind.address.management=54.232.246.186"
AS7_OPTS="$AS7_OPTS -Djboss.bind.address=54.232.246.186"

case "$1" in
    start)
        echo "Starting JBoss AS 7..."
        sudo -u jboss sh ${JBOSS_HOME}/bin/standalone.sh $AS7_OPTS           ##  If running a$
        start-stop-daemon --start --quiet --background --chuid jboss --exec ${JBOSS_HOME}/bin$
        ${JBOSS_HOME}/bin/standalone.sh $AS7_OPTS &
    ;;
    stop)
        echo "Stopping JBoss AS 7..."
        sudo -u jboss sh ${JBOSS_HOME}/bin/jboss-admin.sh --connect command=:shutdown        $
        start-stop-daemon --start --quiet --background --chuid jboss --exec ${JBOSS_HOME}/bin$
        ${JBOSS_HOME}/bin/jboss-cli.sh --connect command=:shutdown
    ;;
    *)
        echo "Usage: /etc/init.d/jbossas7 {start|stop}"; exit 1;
    ;;
esac

exit 0

我遵循了以下站点中提供的示例: 如何将 Jboss AS 7 安装为 Linux 服务 运行 JBoss 服务 HowTo

但是当我运行时:sudo service jboss start 我收到以下消息:老板:无法识别的服务

4

1 回答 1

0

你必须制作脚本

/etc/init.d/jboss

通过以下命令可执行:

sudo chmod +x /etc/init.d/jboss
于 2013-11-29T12:08:06.960 回答