Tuesday, November 12, 2013

How to Restart OATS Services

This article is one of the Oracle Application Test Suite (OATS)[1] series published on Xml and More, which includes the following:
In this article, we will show how to restart OATS services on the Linux system. The Linux system referenced here is Oracle Linux:[2]

$ cat /etc/*-release

Enterprise Linux Enterprise Linux Server release 5.8 (Carthage)
Oracle Linux Server release 5.8
Red Hat Enterprise Linux Server release 5.8 (Tikanga)

/sbin/service


Red Hat (i.e., RHEL 5) includes the service utility to help you manage your start up scripts and save you a lot of typing. This is handy when you're managing the already existing services (e.g., OATS services). /sbin/service is just a shell script (see Appendix) that comes as part of Red Hat's initscripts package.[4]


OATS Services


There are three OATS services running on Linux.[5] To restart them, you use the following commands:

# /sbin/service OracleATSAgent [start|stop]
# /sbin/service OracleATSServer [start|stop]
# /sbin/service OracleATSHelper [start|stop]

There is also a command option (i.e., "status") that allows you to check their current status:

#/sbin/service OracleATSHelper status
OATS Helper Service is running

Note that you need to be the superuser to run the above commands. Also, if you install OATS database on the same server, you need to start your DB first before you restart OATS services.

Appendix


cat /sbin/service
#!/bin/sh

. /etc/init.d/functions

VERSION="`basename $0` ver. 0.91"
USAGE="Usage: `basename $0` < option > | --status-all | \
[ service_name [ command | --full-restart ] ]"
SERVICE=
SERVICEDIR="/etc/init.d"
OPTIONS=

if [ $# -eq 0 ]; then
   echo "${USAGE}" >&2
   exit 1
fi

cd /
while [ $# -gt 0 ]; do
  case "${1}" in
    --help | -h | --h* )
       echo "${USAGE}" >&2
       exit 0
       ;;
    --version | -V )
       echo "${VERSION}" >&2
       exit 0
       ;;
    *)
       if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then
          cd ${SERVICEDIR}
          for SERVICE in * ; do
            case "${SERVICE}" in
              functions | halt | killall | single| linuxconf| kudzu)
                  ;;
              *)
                if ! is_ignored_file "${SERVICE}" \
                    && [ -x "${SERVICEDIR}/${SERVICE}" ]; then
                  env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" status
                fi
                ;;
            esac
          done
          exit 0
       elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then
          SERVICE="${1}"
          if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
            env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" stop
            env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" start
            exit $?
          fi
       elif [ -z "${SERVICE}" ]; then
         SERVICE="${1}"
       else
         OPTIONS="${OPTIONS} ${1}"
       fi
       shift
       ;;
   esac
done

if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
   env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS}
else
   echo $"${SERVICE}: unrecognized service" >&2
   exit 1
fi

References

  1. Oracle Application Testing Suite
  2. Oracle Linux
    • Oracle Linux, formerly known as Oracle Enterprise Linux, is a Linux distribution based on Red Hat Enterprise Linux (RHEL), repackaged and freely distributed by Oracle, available under the GNU General Public License (GPL) since late 2006
  3. How To Install Services on Linux
  4. Understanding your (Red Hat Enterprise Linux) daemons
  5. OpenScript Functional Testing Introduction
    • Services installed by ATS Setup on Linux:
      • Oracle ATS Agent: Remote Agent Service used for Load testing
      • Oracle ATS Helper: OpenScript Helper Service.
      • Oracle ATS Server: Oracle Load Testing & Oracle Test Manager Console. (Weblogic server)
  6. OATS: Tie All Processes Together — from OpenScript to Scenario (Xml and More)

No comments: