Previous versions of JBoss included a scripts (like jboss_init_redhat.sh
) that could be copied to /etc/init.d in order to add it as a service - so it would star
#! /bin/sh
start(){
echo "Starting JBoss 7"
sudo -u jboss sh /usr/local/jboss/bin/standalone.sh
}
stop(){
echo "Stopping JBoss 7"
sudo -u jboss sh /usr/local/jboss/bin/jboss-admin.sh --connect command=:shutdown
}
restart(){
stop
# give stuff some time to stop before we restart
sleep 60
# protect against any services that can't stop before we restart
su -l jboss -c 'killall java'
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: jboss {start|stop|restart}"
exit 1
;;
esac
exit 0