glassfish has no startup script

Bug #150960 reported by wayne on 2007-10-09
This bug affects 2 people
Affects Status Importance Assigned to Milestone
glassfish (Ubuntu)

Bug Description

Binary package hint: glassfish

I've looked around and can't find it. Is this on purpose?

wayne (wayne-flashmedia) wrote :

This seems to work ok.

HarpreetSingh (harpreet-singh) wrote :

The startup script for GlassFish is called asadmin (application server admin). This script is present in the /usr/bin/ directory. There were two primary reason that it was kept this way:
1. The GlassFish community @ is used to this convention. The docs etc that are available have been setup with this command.
2. If the GlassFish community added this particular script - it has to roll back into the GlassFish community as a supported interface available on all platforms. Given that we do have the asadmin script under /usr/bin/asadmin - this does not buy in much.


HarpreetSingh (harpreet-singh) wrote :

I am going to mark this particular bug as invalid due to the reason above. If you disagree - you can shoot me an email at harpreet . singh @ sun
- Harpreet

Matthias Klose (doko) wrote :

I appreciate your interest in having the Ubuntu and Glassfish communities in sync, but please have in mind that the Ubuntu community is used to do things in some ways, i.e, to start a system service with the init script. Please implent the init script, and then feed it back to the glassfish community. What needs to be done:

 - create a system user `glassfish' on package installation. This user should be used to run the application server.
 - If other domains should be started with another user, please add this support to the init script
 - the proposed init script is a good start, but please try to use the lsb functions for init scripts, and maybe
   offer an option to disable startup (/etc/default/glassfish).

Changed in glassfish:
importance: Undecided → Medium
status: New → Confirmed
Thom Pischke (thom-pischke) wrote :

Agree with Matthias and the original bug poster. Glassfish should have an /etc/init.d/ script, and should be run by glassfish user. Most people don't like to run glassfish as root.

Also, I notice that with a fresh apt-get install, when I attempt to run asadmin start-domain, it looks for (and incorrectly creates) a default domain in the root directory. It should be using the default domain in /var/lib/glassfish instead.

> asadmin start-domain domain1
GlassFish Default Domain Not Present
Creating in /root/glassfishv2/domain1

Alexey Kakunin (akakunin) wrote :

Agreed - just found glassfish in ubuntu repository - and was happy to be able to install glassfish by standard ubuntu-way (apt-get install), but - what the sense in the service (glassfish is a service in my case) if there is no way to start it during system start-up?

Just another note - I suppose it is also make sense to start-up default glassfish database during glassfish starting:
asadmin start-database

Also, it make sense to add javadb-client into glassfish dependencies - without it default ConnectionPools is not working after glassfish installation (need to install this package as separate apt-get install javadb-client)

Thom Pischke (thom-pischke) wrote :

Starting up a DB automatically would be bad for my usage, where the DB is on a different server.

Alexey Kakunin (akakunin) wrote :

OK, starting glassfish database may be implemented as separate service.

Nicolas Diogo (nicolasdiogo) wrote :

did anyone create a /etc/init.d/glassfish script to startup glassfish at boot properly?



Alexey Kakunin (akakunin) wrote :

Attachment contains script is used by me - please note - this script started both - JavaDB & Glassfish Itself. Also, since asadmin required passwords to perform any actions, admin password were stored in "password" file and passed into asadmin during starting and stopping server.

Password file should contains line like:

where xxx is your glassfish admin password

jhnet3 (josephh) wrote :

A fix for "No Default Domain" problem is:

* vi /usr/bin/asadmin:
* Change,


(Shouldn't there be an env var for /var/lib/glassfishv2?)

* Start Glassfish with domain1:
$ sudo asadmin start-domain domain1
Starting Domain domain1, please wait.
Log redirected to /var/lib/glassfishv2/domains/domain1/logs/server.log.
Please enter the admin user name>admin
Please enter the admin password>
Redirecting output to /var/lib/glassfishv2/domains/domain1/logs/server.log
Domain domain1 started.
Domain [domain1] is running [Sun Java System Application Server 9.1_01 (build local)] with its configuration and logs at: [/var/lib/glassfishv2/domains].
Admin Console is available at [http://localhost:4848].
Use the same port [4848] for "asadmin" commands.
User web applications are available at these URLs:
[http://localhost:8080 https://localhost:8181 ].
Following web-contexts are available:
[/web1 /__wstx-services hello ].
Standard JMX Clients (like JConsole) can connect to JMXServiceURL:
[service:jmx:rmi:///jndi/rmi://lion:8686/jmxrmi] for domain management purposes.
Domain listens on at least following ports for connections:
[8080 8181 4848 3700 3820 3920 8686 ].
Domain supports application server clusters and other standalone instances.

* Now admin URL is http://localhost:4848
* Domain1 URL is http://localhost:8080

Ryan J (ryan+launchpad) wrote :

I know this is old, but personally I'd prefer to see a startup script in /etc/init.d/glassfish

The first thing I did was create my own anyway. The domain directory being split from the rest of the glassfish install was enough of a change from a standard glassfish install that I had to go hunting around to figure out what was going on anyway.

Perhaps a startup script could be added as a separate package (glassfishv2-startup-script) so it would be possible to get a default install running / starting at boot without having to muck around with any configuration.

sun (sun-6) wrote :

The only glassfish init script I was able to find that is remotely correct is this:

(via parent article: )

I didn't test it myself yet, but upon a cursory look, it seems to have everything that is required. All the other init scripts that have been uploaded here or are referenced across the net aren't using lsb and various validators will complain.

We're going to try that script, correct it where necessary, and most likely also move it into a github repo over the next few weeks.

It is true that the init script should be distributed with the upstream source package, but it certainly doesn't hurt to come up with a working script first, so as to propose a concrete solution for inclusion afterwards.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers