0

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.??

  • 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. – Ahmet Karakaya 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. – Ahmet Karakaya Jan 9 '13 at 7:23
  • UPDATED question. I am having 127 exist status somehow. – Ahmet Karakaya Jan 9 '13 at 7:48
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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