Skip to content

Instantly share code, notes, and snippets.

Created March 14, 2012 01:14
Show Gist options
  • Save anonymous/2033165 to your computer and use it in GitHub Desktop.
Save anonymous/2033165 to your computer and use it in GitHub Desktop.
#!/bin/sh
#set -x
#
# chkconfig: 2345 99 01
# description: starts and stops torquebox
TORQUEBOX_JBOSS_USER=torquebox
if [ "$TORQUEBOX_JBOSS_USER" = "RUNASIS" ]; then
SUBIT=""
else
SUBIT="su - $TORQUEBOX_JBOSS_USER -c "
fi
case "$1" in
'start')
CMD="nohup /opt/torquebox/jboss/bin/standalone.sh -Djboss.bind.address=192.168.100.2 -bmanagement 192.168.100.2 -Djgroups.bind_addr=192.168.100.2 --server-config=standalone-ha.xml -Djboss.node.name=node2 &"
$SUBIT "$CMD"
;;
'stop')
CMD="/opt/torquebox/jboss/bin/jboss-cli.sh --connect controller=192.168.100.2:9999 command=:shutdown "
$SUBIT "$CMD "
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment