#!/usr/bin/ksh93 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # 61haes_r714 src/43haes/usr/sbin/cluster/sa/printServer/sbin/cl_print_server_systemv_start.sh 1.1 # # Licensed Materials - Property of IBM # # COPYRIGHT International Business Machines Corp. 2010 # All Rights Reserved # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # IBM_PROLOG_END_TAG # @(#)66 1.1 src/43haes/usr/sbin/cluster/sa/printServer/sbin/cl_print_server_systemv_start.sh, hacmp, 61haes_r714 11/28/11 14:53:20 ############################################################################### # # Name: cl_print_server_systemv_start # # Description: start script to start System V print subsystem # # Syntax: cl_print_server_systemv_start # # Returns: 0 on SUCCESS # 1 on FAILURE # ############################################################################### ############################################################################### # # Name: isRunning # # Description: Check to see if System V print subsystem is active. # # Arguments: none # # Returns: 0 on RUNNING # 1 on NOT RUNNING # ################################################################################ isRunning() { [[ "$VERBOSE_LOGGING" == "high" ]] && set -x # # Finding out System V print subsystem is active or not # LC_ALL=C /usr/bin/lpstat -r | egrep -ie "scheduler is running" >> $LOG_FILE 2>&1 (( $? == 0 )) && { KLIB_SA_logmsg INFO 3 1 print_server_sa.cat "%1\$s print subsystem is active\n" "System V" return 0 } KLIB_SA_logmsg WARN 3 2 print_server_sa.cat "%1\$s print subsystem is not active\n" "System V" return 1 } ############################################################################### # # Name: doStart # # Description: Start the System V print subsystem. # # Arguments: none # # Returns: 0 on SUCCESS # 1 on FAILURE # ################################################################################ doStart() { [[ "$VERBOSE_LOGGING" == "high" ]] && set -x # : Starting the System V print subsystem. # /usr/lib/lp/lpsched >> $LOG_FILE 2>&1 sleep 5 # : Check the status of System V print subsystem # isRunning (( $? == 0 )) && { KLIB_SA_logmsg INFO 3 3 print_server_sa.cat "%1\$s print subsystem \ started\n" "System V" return 0 } KLIB_SA_logmsg INFO 3 4 print_server_sa.cat "%1\$s print subsystem \ unable to start\n" "System V" return 1 } ############################################################################### # Main program procedure. ############################################################################### PROGNAME=$(basename ${0}) PATH="$($(dirname ${0})/../../../utilities/cl_get_path all)" PATH=$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/sbin FPATH_BASE=/usr/es/lib/ksh93 FPATH=$FPATH_BASE/hacmp:$FPATH_BASE/sa:$FPATH_BASE/db2:$FPATH_BASE/aix:$FPATH_BASE/aix/odm export PATH FPATH # : Load the common variables # . /usr/es/sbin/cluster/sa/printServer/sbin/cl_print_server_common_variables LOG_FILE=$(clodmget -q name=$KLIB_HACMPLOG_ENTRY -f value -d "=" HACMPlogs) LOG_FILE=${LOG_FILE//\"/} LOG_FILE="$LOG_FILE/$KLIB_HACMPLOG_ENTRY" [[ "$VERBOSE_LOGGING" == "high" ]] && set -x DEBUG=${DEBUG:-"0"} VERBOSE=${VERBOSE:-"0"} echo "######################################################" >> $LOG_FILE dspmsg -s 3 print_server_sa.cat 12 "# SYSTEM V PRINT SUBSYSTEM START LOG" >> $LOG_FILE echo "\n######################################################" >> $LOG_FILE # : Find out System V print subsystem is active or not # isRunning (( $? == 1 )) && { KLIB_SA_logmsg INFO 3 5 print_server_sa.cat "Starting %1\$s print subsystem\n" "System V" # : System V print subsystem is not active. : Make an attempt to start System V print subsystem. # doStart exit $? } exit 0