Sun logo      Previous      Contents      Next     

Sun Java System Application Server Platform Edition 8.1 2005Q1 Administration Guide

Appendix A  
Automatically Restarting a Domain

If your domain is stopped unexpectedly (for example, if you need to restart your machine), you can configure your system to automatically restart the domain.

This Appendix contains the following topics:


Restarting Automatically on UNIX Platforms

To restart your domain on a UNIX platform, add a line of text to the /etc/inittab file.

For example, to restart domain1, for an Application Server installed in the opt/SUNWappserver directory, using a password file called password.txt:

das:3:respawn:/opt/SUNWappserver/bin/asadmin start-domain --user admin --passwordfile /opt/SUNWappserver/password.txt domain1

Put the text on one line. The first three letters are a unique designator for the process and can be altered.


Restarting Automatically on the Microsoft Windows Platform

To restart automatically on Microsoft Windows, create a Windows Service. Use the appservService.exe and appserverAgentService.exe executables shipped with Sun Java System Application Server in conjunction with the Service Control command (sc.exe) provided by Microsoft.

The sc.exe command comes with Windows XP and is either located in the C:\windows\system32 directory or C:\winnt\system32 directory. As of 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, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndllpro/html/msdn_scmslite.asp.

Use appservService.exe and appservAgentService.exe as follows:

C:\winnt\system32\sc.exe create service_name binPath= \"fully_qualified_path_to_appservService.exe \"fully_qualified_path_to_asadmin.bat start_command\" \"fully_qualified_path_to_asadmin.bat stop_command\"" start= auto DisplayName= "display_name"

For example, to create a service called SunJavaSystemAppServer DOMAIN1 that starts and stops the domain domain1, using a password file C:\Sun\AppServer\password.txt:

C:\windows\system32\sc.exe create domain1 binPath= "C:\Sun\AppServer\lib\appservService.exe \"C:\Sun\AppServer\bin\asadmin.bat start-domain --user admin --passwordfile C:\Sun\AppServer\password.txt domain1\" \"C:\Sun\AppServer\bin\asadmin.bat stop-domain domain1\"" start= auto DisplayName= "SunJavaSystemAppServer DOMAIN1"


Note

The start and stop commands entered as part of the binPath= parameter must have the correct syntax. To test, run the commands from the command prompt. If the commands do not properly start or stop the domain, the service does not work correctly.



Note

Don’t use a mixture of asadmin start and stop commands and service start and stops. Mixing the two can cause the server status to be out of sync. For example, the service might not show that the component has started even though the component is not running. To avoid this situation, always use the sc.exe command to start and stop the component when using services.



Security for Automatic Restarts

Handle the password and master password required when starting in one of the following ways:



Previous      Contents      Next     


Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.