Last active
December 2, 2016 11:12
-
-
Save zonia3000/84859460be987f3eb62d9194a956a336 to your computer and use it in GitHub Desktop.
GlassFish 4 System V init script
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/bash | |
# | |
# glassfish: Startup script for Glassfish Application Server. | |
# | |
# chkconfig: 3 80 05 | |
# description: Startup script for domain1 of Glassfish Application Server. | |
ASADMIN="/home/glassfish/glassfish4/glassfish/bin/asadmin" | |
USER="glassfish" | |
# For SELinux we need to use 'runuser' not 'su' | |
if [ -x "/sbin/runuser" ]; then | |
SU="/sbin/runuser - -s /bin/sh" | |
else | |
SU="/bin/su - -s /bin/sh" | |
fi | |
case "$1" in | |
start) | |
$SU $USER -c "${ASADMIN} start-domain" | |
;; | |
stop) | |
$SU $USER -c "${ASADMIN} stop-domain" | |
;; | |
restart) | |
$SU $USER -c "${ASADMIN} stop-domain" | |
$SU $USER -c "${ASADMIN} start-domain" | |
;; | |
*) | |
echo "usage: $0 (start|stop|restart|help)" | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment