0

I have Glassfish up and running on a Solaris machine.

I am using putty to connect to that machine.

I start the domain using

asadmin start-domain

I also have remote administration enabled. I am able to login to the admin portal at this time.

The instant i close the putty window the glassfish instance is not longer running.

On a windows machine you can start the domain as a service. What is the equvalent for linux?

eckes
  • 10,103
  • 1
  • 59
  • 71
codeNinja
  • 1,442
  • 3
  • 25
  • 61

2 Answers2

1

If you don't use init scripts or system daemons (this is the equivalent to a service) you must make sure all started programs are detached from the console.

You typically use "nohup asadmin start-domain" for this. You can also do it with disown -h after the fact, as described in this question

Community
  • 1
  • 1
eckes
  • 10,103
  • 1
  • 59
  • 71
1

Glassfish has a command to create a service.

sudo glassfish4/bin/asadmin create-service

Then start the domain like so (the above command prints this path for you)

* /usr/bin/svcs  -a | grep domain1  // status
* /usr/sbin/svcadm enable domain1 // start
* /usr/sbin/svcadm disable domain1 // stop
* /usr/sbin/svccfg delete domain1 // uninstall
codeNinja
  • 1,442
  • 3
  • 25
  • 61