users@glassfish.java.net

Re: Glassfish only works once

From: <forums_at_java.net>
Date: Mon, 9 Dec 2013 11:50:47 -0600 (CST)

Do you have /etc/init.d/glassfish file? I'm assuming you are on linux. If so
here is my example of /etc/init.d/glassfish file:
=========================================================== #! /bin/sh #
chkconfig: 2345 99 01 # description: GlassFish App Server set -e # Increase
file descriptor limit ulimit -n 32768 # Uncomment the next line in case there
are problems locating Java JAVA_HOME="/usr/local/jdk1.7.0_45" export
JAVA_HOME GLASSFISHPATH=/usr/local/glassfish-4.0/glassfish/bin case "$1" in
start) echo -n "Starting GlassFish server from $GLASSFISHPATH" echo " "
$GLASSFISHPATH/asadmin start-domain domain1 # I will uncomment the next line
when I enable https # $GLASSFISHPATH/asadmin --secure start-domain domain1 ;;
restart) $0 stop $0 start ;; stop) echo -n "Stopping GlassFish server from
$GLASSFISHPATH" echo " " $GLASSFISHPATH/asadmin stop-domain domain1 # I will
uncomment the next line when I enable https # $GLASSFISHPATH/asadmin --secure
stop-domain domain1 ;; *) echo "Usage: $0 {start|stop|restart}" exit 3 ;;
esac : =========================================================== After
creating it, I remembered to add execute permissions: chmod a+x
/etc/init.d/glassfish and created the run-level links to start the server in
states 2, 3, 4, and 5 and to terminate in states 0,1, and 6 as follows:
chkconfig --level 2345 glassfish on chkconfig --level 016 glassfish off I
then used the setup tool to make sure the server starts at startup setup All
this I did as super user. I hope I've been of some help.

--
[Message sent by forum member 'rrugemalira']
View Post: http://forums.java.net/node/900383