JBoss7.1.1 Shutdown debian script fails
nschweig Feb 11, 2014 6:09 AMHi,
I followed different instructions, my script for starting and stopping is:
#!/bin/sh
### BEGIN INIT INFO
# Provides: jboss
# 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: Management of JBoss AS v7.x
### END INIT INFO
#Defining JBOSS_HOME
JBOSS_HOME=/opt/jboss711
case "$1" in
start)
echo "Starting JBoss AS7..."
${JBOSS_HOME}/bin/standalone.sh &
;;
stop)
echo "Stopping JBoss AS7..."
${JBOSS_HOME}/bin/jboss-cli.sh --connect command=:shutdown
;;
log)
echo "Showing server.log..."
tail -1000f ${JBOSS_HOME}/standalone/log/server.log
;;
*)
echo "Usage: /etc/init.d/jboss {start|stop|log}"
exit 1
;; esac
exit 0
I get the following error:
org.jboss.as.cli.CliInitializationException: Failed to connect to the controller
at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:229)
at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:195)
at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.modules.Module.run(Module.java:260)
at org.jboss.modules.Main.main(Main.java:291)
Caused by: org.jboss.as.cli.CommandLineException: The controller is not available at localhost:9999
at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:639)
at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:613)
at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:227)
...
Do you have any ideas?
Another question is why do I get more than one pid when I do.
ps -ef | awk '/jbos[s]/ {print $2}'
Thanks a lot!
Nicole