glassfish stops when i close putty window
-
26-12-2019 - |
سؤال
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?
المحلول 2
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
نصائح أخرى
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