Created
March 7, 2012 14:18
-
-
Save jcfischer/1993389 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: Start/Stop JBoss AS v7.0.0 | |
### END INIT INFO | |
# | |
#source some script files in order to set and export environmental variables | |
#as well as add the appropriate executables to $PATH | |
[ -r /etc/profile.d/java.sh ] && . /etc/profile.d/java.sh | |
[ -r /etc/profile.d/torquebox.sh ] && . /etc/profile.d/torquebox.sh | |
case "$1" in | |
start) | |
echo "Starting JBoss AS 7.1.0" | |
#original: | |
#sudo -u jboss sh ${JBOSS_HOME}/bin/standalone.sh | |
#updated: | |
start-stop-daemon --start --quiet --background --chuid torquebox --exec ${JBOSS_HOME}/bin/standalone.sh | |
;; | |
stop) | |
echo "Stopping JBoss AS 7.1.0" | |
#original: | |
#sudo -u jboss sh ${JBOSS_HOME}/bin/jboss-cli.sh --connect command=:shutdown | |
#updated: | |
start-stop-daemon --start --quiet --background --chuid torquebox --exec ${JBOSS_HOME}/bin/jboss-cli.sh -- --connect command=:shutdown | |
;; | |
*) | |
echo "Usage: /etc/init.d/torquebox {start|stop}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export JAVA_HOME=/usr/lib/jvm/default-java | |
export PATH=$JAVA_HOME/bin:$PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: Start/Stop JBoss AS v7.0.0 | |
### END INIT INFO | |
# | |
#source some script files in order to set and export environmental variables | |
#as well as add the appropriate executables to $PATH | |
[ -r /etc/profile.d/java.sh ] && . /etc/profile.d/java.sh | |
[ -r /etc/profile.d/torquebox.sh ] && . /etc/profile.d/torquebox.sh | |
case "$1" in | |
start) | |
echo "Starting JBoss AS 7.1.0" | |
#original: | |
#sudo -u jboss sh ${JBOSS_HOME}/bin/standalone.sh | |
#updated: | |
start-stop-daemon --start --quiet --background --chuid torquebox --exec ${JBOSS_HOME}/bin/standalone.sh | |
;; | |
stop) | |
echo "Stopping JBoss AS 7.1.0" | |
#original: | |
#sudo -u jboss sh ${JBOSS_HOME}/bin/jboss-cli.sh --connect command=:shutdown | |
#updated: | |
start-stop-daemon --start --quiet --background --chuid torquebox --exec ${JBOSS_HOME}/bin/jboss-cli.sh -- --connect command=:shutdown | |
;; | |
*) | |
echo "Usage: /etc/init.d/torquebox {start|stop}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export TORQUEBOX_HOME=/opt/torquebox-current | |
export JBOSS_HOME=$TORQUEBOX_HOME/jboss | |
export JRUBY_HOME=$TORQUEBOX_HOME/jruby | |
export PATH=$JRUBY_HOME/bin:$PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment