Contents SAS/IntrNet 9.1: Application Dispatcher Previous Next

Services on UNIX Platforms

Creating a Service

To create a service for an Application Server running in a UNIX environment, perform the following steps:

  1. From a system prompt, submit the following command:
       SASROOT/utilities/bin/inetcfg.pl
    

    where SASROOT is the path to the SAS root directory.

    As the configuration utility runs, you are prompted for information about the service that you are creating.

  2. For the first prompt, type the name of the service. Press Return to accept the default value, which names the service default. To create a service other than default, type the service name, and then press Return.

  3. The next prompt asks for the name of the directory where all of the service control files should be stored. Press Return to accept the suggested value, or type the desired directory name and then press Return.

  4. Specify the type of service you are defining. Type S if you are defining a socket service, L for a launch service, or P for a pool service. Press Return to continue.

  5. If you choose a socket service, specify the number of servers that you want to include in this service. Note that the number you specify here represents only those servers running on this physical machine.

    If there is only one server, press Return. If you plan to have multiple servers, type the number, and then press Return.

  6. If you select a socket service, you are prompted to enter a TCP/IP port number or name for each of the servers that you requested as the answer to the previous prompt. Type the value and press Return.

  7. If you choose a socket or a pool service, the script will ask if you want to protect this service with an administrator password. Answer Y or N and press Return. Supply a password and press Return.

  8. Next, the utility displays the information that you entered for this service. Verify that the information is correct.

    If the information is correct, press Return. The utility creates the service. Read the messages printed by the utility to determine if the service was created correctly. One of these messages contains the path for the service directory created by the utility. You should note this path for use later in this process.

    If you want to change the information, type N and press Return. The script exits and you can rerun the script.

  9. If you are creating a pool service, you must install the Application Load Manager. You might also want to install the Load Manager if you have a socket service with more than one server. See Using the Load Manager for more information.

  10. If you are creating a pool service, you might need to install the SAS Spawner. The Spawner is not required if you configure the Application Load Manager to start the service directly. If you choose this method, the servers must all execute on the same system as the Load Manager and under the same user ID. The Spawner is not required if you choose to use the UNIX telnet daemon to start the servers. Refer to the SAS/CONNECT documentation for installation instructions for the SAS Spawner.

  11. The Application Broker must know about this service so that you can access it. Open the Broker configuration file on your Web server in an editor and add a service definition block. Example service definitions are found in the template configuration file installed with the Application Broker. Several examples are shown below. Values that may need to be changed for your site are shown in green.
    • The definition block for a socket service might look like

      # This service contains one server (port 5801) on yourserv.yyy.com.
      SocketService service-name "brief-text-desc"
      ServiceDescription "text-desc"
      ServiceAdmin "administrator-name"
      ServiceAdminMail "administrator-email-address@host"
      Server yourserv.yyy.com
      Port 5801

    • Launch services are defined with

      LaunchService service-name "brief-text-desc"
      ServiceDescription "text-desc"
      ServiceAdmin "administrator-name"
      ServiceAdminMail "administrator-email-address@host"
      SasCommand "/usr/local/bin/sas+
      /usr/local/intrnet/service-name/appstart.sas+
      -rsasuser -noterminal -noprint -nolog -SYSPARM"

    • A pool service that is started directly by the Load Manager is defined by

      # Start up to 2 servers on the same node as the Load Manager. No
      # username/password or spawner is needed for this case. Servers will
      # time out after 30 minutes.
      PoolService service-name
      ServiceDescription "text-desc"
      ServiceAdmin "administrator-name"
      ServiceAdminMail "administrator-email-address@host"
      ServiceLoadManager yourserv.xxx.com:5555
      SasCommand "/usr/local/bin/sas+
      /usr/local/intrnet/service-name/appstart.sas+
      -rsasuser -noterminal -noprint -nolog -SYSPARM"
      IdleTimeout 30
      Server yourserv.xxx.com
      Port 2

    • A pool service that is started by the SAS Spawner is defined by

      # Start up to 5 servers on node yourserv.yyy.com using the spawner
      # started at port 7777. All servers will be started with the
      # specified username/password. At least 1 server will not timeout
      # and be kept running.
      PoolService service-name
      ServiceDescription "text-desc"
      ServiceAdmin "administrator-name"
      ServiceAdminMail "administrator-email-address@host"
      ServiceLoadManager load-manager-host:port
      SasCommand "/usr/local/bin/sas+
      /usr/local/intrnet/service-name/appstart.sas+
      -rsasuser -noterminal -noprint -nolog -SYSPARM"
      Server yourserv.yyy.com
      Port 6000-6004
      Username appdemo
      Password xyzzy
      SpawnerPort 7777
      MinRun 1

Starting the Service

Socket services must be started with the start.pl script created by the configuration utility. To start the service, change to the service root directory created by the utility. Then submit the following:

   ./start.pl

Launch services are started automatically by the Application Broker. Pool services are started automatically by the Application Load Manager. See Using the Load Manager for more details.

Once a service is started, you can test it from a Web browser. The URL will depend on the platform and path where your Application Broker is installed. For typical installs, the URL to test (or "ping") a service will be one of the following:

UNIX and z/OS:
http://yourserver/cgi-bin/broker?_service=service-name&_program=ping

Windows:
http://yourserver/scripts/broker.exe?_service=service-name&_program=ping

You must specify your Web server name in place of yourserver and your service name in place of service-name. You might need to use a different URL path if you chose a different path when you installed the Application Broker. If the service is running, an HTML page will be returned stating that the Application Server is functioning.

Stopping the Service

Socket or pool services can be stopped from a Web browser. The URL will depend on the platform and path where your Application Broker is installed. For typical installs, the URL to stop a service will be one of the following:

UNIX and z/OS:
http://yourserver/cgi-bin/broker?_service=service-name&_program=stop

Windows:
http://yourserver/scripts/broker.exe?_service=service-name&_program=stop

You must specify your Web server name in place of yourserver and your service name in place of service-name. You might need to use a different URL path if you chose a different path when you installed the Application Broker.

Service Log Files

Log files are placed in the logs directory under the service root directory and are named <day>_<port>.log. For example, Mon_5001.log or Tue_5001.log. By default, logs are kept for one week (six full days and one partial day) and then overwritten.

SAS 9 has implemented a set of % codes that can be used in the -log parameter. You must add a -logparm option in order to get the codes translated into the log. For example adding

   -log '/full-service-root-path/service-name/logs/appsrv_%v.log'
   -logparm rollover=auto

creates log files with unique log filenames. The rollover=auto option causes an automatic "rollover" of the log when the directives in the value of the LOG option change. This is particularly useful for generating log files for pool or launch services. This example creates log filenames such as appsrv_1.log, appsrv_2.log, and appsrv_3.log.

Note: You must use a full path to specify the log file because there is limited control over what path the Load Manager or spawner will use as the current directory for each Application Server.

For more information, see the documentation on the LOGPARM= system option in SAS Language Elements.

Removing a Service

A service can be removed by deleting the service root directory and its contents. Any active servers must be stopped before deleting this directory.


Contents SAS/IntrNet 9.1: Application Dispatcher Previous Next