Sun Java System Application Server Platform Edition 8.2 Troubleshooting Guide

Automatically Restarting a Domain or Node Agent on Reboot

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

Restarting Automatically on UNIX Platforms

Restarting a Domain

To restart your domain on a UNIX platform, add a line containing the appropriate asadmin start-domain command to your /etc/inittab file. If you use /etc/rc.local, or your system’s equivalent, place a the desired asadmin command in /etc/rc.local.

For example, to restart domain1 for an Troubleshooting Guide installed in the /opt/SUNWappserver directory, using a password file called password.txt, add the following line to /etc/inittab or /etc/rc.local:

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

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

Restarting a Node Agent

To restart a node agent, the syntax is similar. For example, to restart agent1 for an Troubleshooting Guide installed in the /opt/SUNWappserver directory using a password file called password.txt, add the following line to /etc/inittab or /etc/rc.local:

das:3:respawn:/opt/SUNWappserver/bin/asadmin start-node-agent --user admin 
--passwordfile /opt/SUNWappserver/password.txt agent1

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.

Starting and Stopping a Domain

To create a service called SunJavaSystemAppServer DOMAIN1 that starts and stops domain1 using password file C:\\Sun\\AppServer\\password.txt, run the following command:


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"

Starting and Stopping a Node Agent

To create a service that starts and stops the node agent agent1, run the following command:


C:\\windows\\system32\\sc.exe create agent1 binPath= "C:\\Sun\\AppServer\\
lib\\appservAgentService.exe \\"C:\\Sun\\AppServer\\bin\\asadmin.bat 
start-node-agent --user admin --passwordfile C:\\Sun\\AppServer\\
password.txt agent1\\" \\"C:\\Sun\\AppServer\\bin\\asadmin.bat 
stop-node-agent agent1\\"" start=auto DisplayName="SJESAS_SE8.1 AGENT1"

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 or node agent, the service will not work correctly.

Also, do not 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: