Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

ASADMIN="/root/Downloads/glassfish3/glassfish/bin/asadmin"

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

Links.

   /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
show 3 more comments

1 Answer

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
add comment

Your Answer

 
discard

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.