Automatically restarting server processes

There are several server processes related to WebSphere Application Server products that the operating system can monitor and automatically restart when the server processes stop abnormally.

Before you begin

[AIX] [HP-UX] [Linux] [Solaris] To set up this function on a Linux or supported UNIX operating system, you must have root authority to edit the inittab file.

[Windows] To set up this function on a Microsoft Windows operating system, you must belong to the Administrator group and have the following advanced user rights:
  • Act as part of the operating system
  • Log on as a service

The Installation wizard grants you the user rights if your user ID is part of the administrator group.

[Windows] If you are running on a Microsoft Windows operating system, the Installation wizard displays a message that states that although the advanced user rights are now effective, they do not display as effective until the next time you log on to the Windows machine.

[Windows] You can also add the advanced user rights manually if you are performing a silent installation on a Windows operating system. For example, to grant the user rights to your administrator group user ID on a Windows operating system, perform the following procedure:
  1. Click Administrative Tools in the Control Panel.
  2. Click Local Security Policy.
  3. Click Local Policies.
  4. Click User Rights Assignments.
  5. Right click Act as part of the operating system.
  6. Click Security.
  7. Click Add.
  8. Click your user ID.
  9. Click Add.
  10. Click OK.
  11. Click OK.
  12. Right click Log on as a service.
  13. Click Security.
  14. Click Add.
  15. Click OK.
  16. Click OK.
  17. Reboot your machine to make the settings effective.

[Windows] Consult your Windows help system for more information.

[Windows] [Fix Pack 9 or later]
[This information only applies to Version 6.1.0.9 and later running on the Microsoft Windows Vista operating system.] [Fix Pack 9 or later] Notes on running an application server as a service on Microsoft® Windows Vista™ and WIndows 2008 operating systems:
  • An application server that is running as a service needs to run with Administrator privileges if it is to be started or stopped on these operating systems.

    The service can be configured to automatically start on system reboot, or it can be manually started and stopped from the Windows® Services panel after accepting the elevation prompt for Administrator privileges.

  • Using the WASService.exe utility to change the characteristics of the service or to create a new service also requires running with Administrator privileges.
    To do this, run WASService.exe from a command prompt that is launched by performing the following actions:
    • Right-click the command file or its shortcut.
    • Click Run As Administrator.
  • The following .bat files can be executed to result in service actions:
    • startServer.bat
    • stopServer.bat

    It is not possible to alter or control these service actions while running with standard user privileges. Administrator privileges are required.

    If an application server is installed as a service, then the service can be controlled by running the .bat files from a Command Prompt window that is launched by performing the following actions:
    • Right-click a Command Prompt shortcut.
    • Click Run As Administrator.

    If an application server is not configured to run as a service, then running these utilities from an elevation prompt for Administrator privileges is not required.

About this task

You can use this function to automatically restart base servers. You can restart the server1 process, for example.

[AIX] [HP-UX] [Linux] [Solaris] You must manually create a shell script that automatically starts any of the processes previously mentioned. Each UNIX shell script controls a single process, such as a stand-alone WebSphere Application Server instance. Multiple stand-alone Application Server processes require multiple UNIX scripts, which you can define.

[Windows] If you do not install the WebSphere Application Server base product as a Windows service during installation, you can use the do so at a later time. The operating system can then monitor each server process and restart the process if it stops.

Procedure

  1. [Windows] Use the installation wizard to set up a Windows service to automatically monitor and restart processes related to the WebSphere Application Server product.
    • Perform the following procedure from the installation wizard to select services that the installation wizard can set up:
      1. Click Run WebSphere Application Server as a service.
        If you select this option, the installation wizard creates the following service during the installation:
        IBMWAS6Service - node_name 

        The IBMWAS6Service - node_name service controls the node_name process.

        After you complete and verify the installation, use the Windows Services panel to change the IBMWAS6Service - node_name service to an automatic startup type.
        1. Right click IBMWAS6Service - node_name and click Properties.
        2. Click Automatic from the Startup type list box and click OK.
      2. Click Run IBM HTTP Server as a service.

        Select this option on the machine where you are installing the IBM HTTP Server.

        If you select this option, the installation wizard creates the following services during the installation:
        • IBM HTTP Server 2.0.x
        • IBM HTTP Administration 2.0.x
        The installation wizard defines the startup type of these services as automatic. It is not necessary for you to change the type from manual to automatic.
      3. Enter your user ID and password and click Next.

      In a coexistence environment, you can change the default service names to make them unique. In a same version coexistence scenario for IBM HTTP Server 2.0.x on a Windows platform, you cannot use the default service names created by the installer because they are common.

      To work around this problem:
      1. Install the first copy of IBM HTTP Server, either by itself or with WebSphere Application Server and select to install the services.
      2. Customize the service names for the first install by running the following commands from the first install location:
             apache -k install -n "IHS 2.0(1)"
             apache -k install -f conf\admin.conf -n "IHS 2.0 Administration (1)"
      3. Edit the AdminAlias directive in the installLocation 1\conf\admin.conf file to point to the new service name, such as IHS 2.0(1).
      4. Remove the default service names installed by the first install by running the following commands:
             apache -k uninstall -n "IBM HTTP Server 2.0"
             apache -k uninstall -n "IBM HTTP Administration 2.0"
      5. Install the second copy of IBM HTTP Server, either by itself or with WebSphere Application Server. The default service names correspond to the second install.
      Avoid trouble Avoid trouble: Customized service names must be unique on your system.gotcha
  2. [AIX] [HP-UX] [Linux] [Solaris] After you install the WebSphere Application Server product, set up a shell script to automatically monitor and restart any related server processes.
    Supported configurations Supported configurations: There are two sets of substeps to complete this task. The first set of substeps do not apply on the Red Hat Enterprise Linux Version 6 operating system. For more information on this operating system, see the second set of substeps. sptcfg
    1. Locate the rc.was example shell script, which is in the app_server_root/bin directory.
    2. Create a new shell script for each process that the operating system is to monitor and restart.
    3. Edit each shell script according to comments in its header, which provide instructions for identifying a WebSphere Application Server process.
    4. Edit the inittab file of the operating system, to add an entry for each shell script you have created.

      Comments in the header of the rc.was file include a sample inittab entry line for adding this script to the inittab table. Each inittab entry causes the operating system to call the specified shell script whenever the system initializes. As each shell script runs, it monitors and starts the server process you specified.

      For example, if you create the following inittab entry for a process, the rc.was shell script is run whenever the system initializes, and if the process goes down while the system is initializing into a machine that is operating at a runlevel of 2, 3, or 5:
      was:235:respawn:/usr/WebSphere/AppServer/bin/rc.was >/dev/console 2>&1 
      If you create the following inittab entry, the rc.was shell script only runs once when you initialize into a machine that is operating at a runlevel of 2,3, or 5:
      was:235:once:/usr/WebSphere/AppServer/bin/rc.was >/dev/console 2>&1 
      Following is a list of the runlevels that can be specified. Runlevels usually default to either 3 or 5.
      • 0-halt
      • 1-Single user mode
      • 2-Multiuser, without NFS (The same as 3, if you don't have networking)
      • 3-Full multiuser mode
      • 4-unused
      • 5-X11
      • 6-Reboot
      If you don't know the runlevel into which your machine is booting, look at the following line in the inittab file:
      id:x:initdefault

      where x is the runlevel that the machine is booting into.

      For example, if your machine is booting into a runlevel of 5, then all of the processes that are declared to run with a runlevel of 5 are started.

      Avoid trouble Avoid trouble: Everything that is ran from the inittab file runs under the root user. Therefore, if you need the server to automatically start the process under a non-root user ID when the machine starts, you must also add the following line to the inittab file:
      su user -c values

      where values is the file path and arguments that are used to call the rc scripts you created, and user is the non-root user that you have configured WebSphere Application Server to run as.

      gotcha
    Supported configurations [Linux] Supported configurations: The following set of substeps apply to the Red Hat Enterprise Linux Version 6 operating system.sptcfg
    1. Create the as1.conf file to monitor and restart processes and place it in the /etc/init directory. The following code is example content for the as1.conf file:
      # upstart service for my application server profile
      
      description  "my application server"
      
      start on runlevel [235]
      stop on runlevel [!235]
      
      expect fork
      respawn
      
      exec /opt/IBM/WebSphere/AppServer/bin/rc.as1
    2. Create the rc.as1 file to restart the server and place it in the install_root/bin directory for WebSphere® Application Server. The following code is example content for the rc.as1 file:
      #!/bin/sh
      cd /opt/IBM/WebSphere/AppServer/profiles/profile_name/bin
      ./startServer.sh server_name

      profile_name represents the name of your application server profile. server_name is the name of your server. Change these values to match your environment.

    Each shell script monitors and restarts an Express server process.

  3. Click Apply and then click Save to save the change directly to the master configuration.

Results

[Windows] On a Windows operating system, you can
  • Use the net start and net stop commands to control the IBM HTTP Server services on a Windows system. For more information about these commands, see the Windows help file. Access these commands from the Start menu, clicking Start > Programs > IBM HTTP Server.
  • Use the Start the Server and Stop the Server commands to control the IBM WebSphere Application Server process. Access these commands from the Start menu, clicking Start > Programs > IBM WebSphere > Application Server V6.

Processes started by a startServercommand are not running as monitored processes, regardless of how they are configured.

For example, you can configure a server1 process as a monitored process. However, if you start the server1 process using the startServer command, the operating system does not monitor or restart the server1 process because the operating system did not originally start the process as a monitored process.

What to do next

After the process is set up, the operating system can monitor each server process and restart the process if it stops.

Return to the Defining application server processes administrative console page to continue.




In this information ...


Related reference

IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Aug 30, 2013 4:53:43 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=pix&product=was-base-dist&topic=trunprocessrestart
File name: trun_processrestart.html