Created
September 1, 2013 03:36
-
-
Save gabrielkfr/6402172 to your computer and use it in GitHub Desktop.
Script de arranque para servidor de aplicaciones GlassFish, aunque en las versiones superiores a la 3.0.1 el asistente de instalación ya permite crear el script de arranque automáticamente.
This file contains 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 | |
# Author: www.tormentadebits.com | |
# | |
# /etc/init.d/glassfish | |
# | |
### BEGIN INIT INFO | |
# Provides: glassfish | |
# Required-Start: $network | |
# Required-Stop: $network | |
# Default-Start: 3 5 | |
# Default-Stop: 0 1 2 6 | |
# Short-Description: Glassfish | |
# Description: Glassfish | |
### END INIT INFO | |
export AS_JAVA=/usr/java/latest | |
GLASSFISHPATH=/opt/glassfish3 | |
. /etc/rc.status | |
# The echo return value for success (defined in /etc/rc.config). | |
case "$1" in | |
start ) | |
echo "Starting service Glassfish!" | |
## | |
## Start daemon with startproc(8). If this fails | |
## the echo return value is set appropriate. | |
$GLASSFISHPATH/bin/asadmin start-domain | |
;; | |
stop ) | |
echo "Shutting down service Glassfish!" | |
## Stop daemon with killproc(8) and if this fails | |
## set echo the echo return value. | |
$GLASSFISHPATH/bin/asadmin stop-domain | |
;; | |
restart ) | |
$0 stop | |
$0 start | |
;; | |
status ) | |
echo -n "Checking for service Glassfish: " | |
## Check status with checkproc(8), if process is running | |
## checkproc will return with exit status 0. | |
$GLASSFISHPATH/bin/asadmin list-applications | |
echo | |
$GLASSFISHPATH/bin/asadmin list-http-listeners | |
;; | |
* ) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
rc_exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment