Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As far as I know command statement below is used to create Glassfish service, After execution following command. GlassFish_domain1 file is created under /etc/init.d directory. And link files are created at each directory /etc/rc0.d, /etc/rc1.d ... /etc/rc6.d

asadmin create-service

But when I have restarted the machine on which Glassfish is installed, Glassfish does not start.

Here is the file created GlassFish_domain1


case "$1" in
    $ASADMIN start-domain    --domaindir /root/Downloads/glassfish3/glassfish/domains  domain1 > /dev/null 2>&1 &
    $ASADMIN stop-domain   --domaindir /root/Downloads/glassfish3/glassfish/domains  domain1 > /dev/null 2>&1 &
    $ASADMIN restart-domain   --domaindir /root/Downloads/glassfish3/glassfish/domains  domain1 > /dev/null 2>&1 &
    echo "usage: $0 (start|stop|restart|help)"


   /etc/rc0.d/K20glassfish -> ../init.d/GlassFish_domain1
   /etc/rc1.d/K20glassfish -> ../init.d/GlassFish_domain1
   /etc/rc6.d/K20glassfish -> ../init.d/GlassFish_domain1
   /etc/rc2.d/S20glassfish -> ../init.d/GlassFish_domain1
   /etc/rc3.d/S20glassfish -> ../init.d/GlassFish_domain1
   /etc/rc4.d/S20glassfish -> ../init.d/GlassFish_domain1
   /etc/rc5.d/S20glassfish -> ../init.d/GlassFish_domain1

I have checked it out agin that I am having 127 exit status when glassfish gets run automatically.??

share|improve this question
What can you find within the log file in /root/Downloads/glassfish3/glassfish/domains/domain1/log/server.log ? – patricks Jan 9 '13 at 7:01
There is nothing. I think something does not allow execution. – mmc18 Jan 9 '13 at 7:09
if you start /etc/init.d/GlassFish_domain1 all works fine? – patricks Jan 9 '13 at 7:10
yes if I execute "/etc/init.d/GlassFish_domain1 start" manually all work fine. – mmc18 Jan 9 '13 at 7:23
UPDATED question. I am having 127 exist status somehow. – mmc18 Jan 9 '13 at 7:48

I have found out the problem. JAVA_HOME has to be set and JAVA_HOME/bin has to be inserted in to PATH in script under /etc/rcX.d X is the runlevel index number. Actually I did same setting in "/root/.profile" but perhaps before execution of ".profile" scripts under /etc/rcX.d run.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.