[jboss-user] [Installation, Configuration & Deployment] - Re: JBOSS runs as a service, but will not autostart

geneellis do-not-reply at jboss.com
Wed Sep 30 13:39:49 EDT 2009


Ok I see. I will make this changes tonight and let you know what I find. I am not using that exact script, but a simplified version. Basically this one:

#! /bin/sh
  | 
  | 
  | start(){
  |         echo "Starting jboss.."
  | 
  |         # If using an SELinux system such as RHEL 4, use the command below
  |         # instead of the "su":
  |         # eval "runuser - jboss -c '/opt/jboss/current/bin/run.sh > /dev/null 2> /dev/null &'
  |         # if the 'su -l ...' command fails (the -l flag is not recognized by my su cmd) try:
  |         #   sudo -u jboss /opt/jboss/bin/run.sh > /dev/null 2> /dev/null &
  |         su -l jboss -c '/opt/jboss/current/bin/run.sh > /dev/null 2> /dev/null &'
  | }
  | 
  | stop(){
  |         echo "Stopping jboss.."
  | 
  |         # If using an SELinux system such as RHEL 4, use the command below
  |         # instead of the "su":
  |         # eval "runuser - jboss -c '/opt/jboss/current/bin/shutdown.sh -S &'
  |         # if the 'su -l ...' command fails try:
  |         #   sudo -u jboss /opt/jboss/bin/shutdown.sh -S &
  |         su -l jboss -c '/opt/jboss/current/bin/shutdown.sh -S &'
  | }
  | 
  | restart(){
  |         stop
  | # give stuff some time to stop before we restart
  |         sleep 60
  | # protect against any services that can't stop before we restart (warning this kills all Java instances running as 'jboss' user)
  |         su -l jboss -c 'killall java'
  | # if the 'su -l ...' command fails try:
  |         #   sudo -u jboss killall java
  |         start
  | }
  | 
  | 
  | 
  | 
  | case "$1" in
  |   start)
  |         start
  |         ;;
  |   stop)
  |         stop
  |         ;;
  |   restart)
  |         restart
  |         ;;
  |   *)
  |         echo "Usage: jboss {start|stop|restart}"
  |         exit 1
  | esac
  | 
  | exit 0

Thanks so much for your help!

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257966#4257966

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257966



More information about the jboss-user mailing list