-
1. Re: Easy question: ¿how to run JBOSS 4.2 as a Daemon?
prieser Sep 9, 2013 2:46 PM (in response to prieser)Currently mi script is this:
#! /bin/sh
start(){
echo "Starting jboss.."
sudo -u root /usr/local/jboss/bin/run.sh
echo "jboss started"
}
stop(){
echo "Stopping jboss.."
sudo -u root /usr/local/jboss/bin/shutdown.sh -S &
echo "jboss stoped"
}
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)
sudo -u root killall java
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: jboss {start|stop|restart}"
exit 1
esac
exit 0
when I execute sudo -u root /usr/local/jboss/bin/run.sh works fine, but when I execute service jboss start it is not.