2
我在Ubuntu 12.04上啓動JBoss 7版本7.1.1 Final時出現問題JDBoss放在/usr/share/jboss
中。 腳本放在/etc/init.d/jboss下面。Ubuntu上的JBoss As 7服務12.04
#!/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
我跟着例子呈現在以下網站: How to Install Jboss AS 7 as a Linux service Run JBoss service HowTo
但是當我運行:sudo service jboss start
我得到以下信息:老闆:無法識別的服務