users@glassfish.java.net

Re: Leopard Glassfish Startup?

From: Leonard Sitongia <sitongia_at_ucar.edu>
Date: Thu, 21 Feb 2008 17:57:49 -0700

Here's my StartupItems configuration. YMMV. I don't have access to the
wiki, wherever it it, so someone can post this if they like.

/Users/sitongia$ ls -lR /Library/StartupItems/SJSAS/
total 16
drwxr-xr-x 3 root wheel 102 Jul 28 2004 Resources
-rwxr-xr-x 1 root wheel 673 Oct 25 07:30 SJSAS
-rw-r--r-- 1 root wheel 250 Oct 25 07:27 StartupParameters.plist

/Library/StartupItems/SJSAS/Resources:
total 0
drwxr-xr-x 3 root wheel 102 Oct 25 07:28 English.lproj

/Library/StartupItems/SJSAS/Resources/English.lproj:
total 8
-rw-r--r-- 1 root wheel 247 Oct 25 07:28 Localizable.strings

/Users/sitongia$ cat
/Library/StartupItems/SJSAS/Resources/English.lproj/Localizable.strings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM
"file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
        <key>Starting Glassfish</key>
        <string>Starting Glassfish</string>
</dict>
</plist>

/Users/sitongia$ cat /Library/StartupItems/SJSAS/StartupParameters.plist
{
  Description = "Glassfish";
  Provides = ("Servlet Engine");
  Requires = ("DirectoryServices");
  OrderPreference = "None";
  Messages =
    {
        start = "Starting Glassfish";
        stop = "Stopping Glassfish";
    };
}

/Users/sitongia$ cat /Library/StartupItems/SJSAS/SJSAS
#!/bin/sh

. /etc/rc.common

export JAVA_HOME=/Library/Java/Home
#export JAVA_OPTS="-server -Xms128m -Xmx128m"
export GLASSFISH_HOME=/usr/local/glassfish-v2

##
# Start the Glassfish Glassfish
##

StartService ()
{
        if [ "${SJSAS:=-NO-}" = "-YES-" ]; then
                ConsoleMessage "Starting Glassfish"
                $GLASSFISH_HOME/bin/asadmin start-domain domain1
        fi
}

StopService ()
{
        ConsoleMessage "Stopping Glassfish"
        $GLASSFISH_HOME/bin/asadmin stop-domain domain1
}

RestartService ()
{
        if [ "${SJSAS:=-NO-}" = "-YES-" ]; then
                ConsoleMessage "Reloading Glassfish"
                StopService
                StartService
        else
                StopService
        fi
}

RunService "$1"

/Users/sitongia$ fgrep SJSAS /etc/hostconfig
SJSAS=-YES-

I think that's it.

-- 
==Leonard E. Sitongia
   High Altitude Observatory
   National Center for Atmospheric Research
   P.O. Box 3000 Boulder CO 80307  USA
   sitongia_at_ucar.edu  voice: (303)497-2454  fax: (303)497-1589