dev@glassfish.java.net

Starting Glassfish as a Linux daemon

From: Wouter van Reeven <wouter_at_van.reeven.nl>
Date: Wed, 6 Dec 2006 23:06:18 +0100

Hi all,


Using the script I posted a few weeks ago on users_at_glassfish I have been running
Glassfish V1 for several weeks now. I am trying to make

asadmin create-service

in Glassfish V2 work on Linux like it does on Solaris and I]d klime to use my
Linux script as a base.

I finally was able to spend some time on this. First I want to get to know how
the process works on Solaris so I can mimic it on Linux. Then I can focus on
how to integrate it into the current source stack.
So, I installed Solaris 10 in VMWare and followed the steps in Kendars blog

http://blogs.sun.com/bloggerkedar/entry/app_server_and_solaris_10

This works like a charm. So next I started to investigate what happens if I do
the same thing on Linux. I get errors about the "auths" command not found.

Strange.

So I installed Maven 1.0.2 and downloaded the Glassfish source. After much
mucking about in the source code, I found the problem. Line 134 of
CreateServiceCommand.java is

service.setOSUser();

which throws the error. This method eventually tries to call the 'auths' command
which isn't available under Linux while it is on Solaris.
I noticed that SMFServiceHandler.java contains the private method
testPlatform() which tests for the correct OS. If I make the method public and
add these lines

try {
    sh.testPlatform();
} catch (Exception e) {
    throw new CommandException(e.getMessage());
}

at line 125 of CreateServiceCommand.java, I get this message when I try to call
the create-service command:

Present Platform, OS: Linux version: 2.6.17-2-686 is not Solaris 10. This
facility is not supported on platforms other than Solaris 10.

Can anyone explain to me why the testPlatform() command isn't called before
trying to access any of the platform specific code? Should I create an issue
for this and post a patch t resolve this as per the guidelines on

https://glassfish.dev.java.net/public/GuidelinesandConventions.html#Submit_a_Patch

?


Thanks in advance for your answer.


Kind regards, Wouter van Reeven


-- 
People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"