Restarting Automatically Using inittab on Solaris 9 and LinuxPlatforms
Torestart your domain on the Solaris 9 or Linux platform, add a line of text to the
/etc/inittable.
Ifyou use /etc/rc.local, or your system’s equivalent, place a line in /etc/rc.local that calls
thedesired asadmin command.
Forexample, to restart domain1 for an Enterprise Server installed in the opt/SUNWappserver
directory,using a password le called password.txt:
das:3:respawn:/opt/SUNWappserver/bin/asadmin start-domain --user admin
--passwordfile /opt/SUNWappserver/password.txt domain1
Putthe text on one line. The rst three letters are a unique designator for the process and can be
altered.
Torestart a node agent, the syntax is similar. For example, to restart agent1 for an Enterprise
Serverinstalled in the opt/SUNWappserver directory, using a password le called
password.txt:
das:3:respawn:/opt/SUNWappserver/bin/asadmin start-node-agent --user admin
--passwordfile /opt/SUNWappserver/password.txt agent1
Restarting Automatically on the MicrosoftWindows Platform
Torestart automatically on Microsoft Windows, create a Windows Service and prevent the
servicefrom shutting down when a user logs out.

Creatinga Windows Service

Usethe appservService.exe and appserverAgentService.exe executable les shipped with
theSun GlassFish Enterprise Server in conjunction with the Service Control command
(sc.exe)provided by Microsoft.
Thesc.exe command comes with Windows XP and is in the system32 subdirectory of the
Windowsinstallation directory (usually either C:\windows\system32 or C:\winnt\system32).
Asof this writing, the Windows 2000 sc.exe is available for download at
ftp://ftp.microsoft.com/reskit/win2000/sc.zip.For more information on using sc.exe,
seehttp://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dndllpro/html/msdn_scmslite.asp.
UseappservService.exe and appservAgentService.exe as follows:
RestartingAutomatically on the MicrosoftWindows Platform
AppendixA • Automatically Restarting a Domain or Node Agent 223