#!/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_powerpc_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_powerpc_start.sh, hacmp, 61haes_r714 11/28/11 15:15:04 ############################################################################### # # Name: cl_print_server_powerpc_start # # Description: start script to start PowerPC print subsystem # # Syntax: cl_print_server_powerpc_start # # Returns: 0 on SUCCESS # 1 on FAILURE # ############################################################################### ############################################################################### # # Name: isRunning # # Description: Check to see if PowerPC print subsystem is active. # # Arguments: none # # Returns: 0 on RUNNING # 1 on NOT RUNNING # ################################################################################ isRunning() { [[ "$VERBOSE_LOGGING" == "high" ]] && set -x # : PowerPC print subsystem to be active, following daemons should be active : qdaemon, writesrv and lpd # DAEMONS="lpd qdaemon writesrv" KLIB_SA_logmsg INFO 3 6 print_server_sa.cat "The PowerPC print subsystem is active, \ if \"lpd\", \n\ \"qdaemon\", and \"writesrv\" daemons are active\n" for daemon in $DAEMONS do KLIB_SA_logmsg INFO 3 7 print_server_sa.cat "Verifying %1\$s daemon\n" "$daemon" LC_ALL=C /usr/bin/lssrc -s $daemon | grep -iw active >> $LOG_FILE 2>&1 if (( $? == 0 )); then KLIB_SA_logmsg INFO 3 8 print_server_sa.cat "%1\$s daemon is active\n" "$daemon" else KLIB_SA_logmsg INFO 3 9 print_server_sa.cat "%1\$s daemon is not active\n" "$daemon" KLIB_SA_logmsg WARN 3 2 print_server_sa.cat "%1\$s print \ subsystem is not active\n" "PowerPC" return 1 fi done # : All required daemons are active which means : PowerPC print subsystem is active # KLIB_SA_logmsg INFO 3 10 print_server_sa.cat "The required daemons for %1\$s \ print subsystem are active\n" "PowerPC" KLIB_SA_logmsg INFO 3 1 print_server_sa.cat "%1\$s print subsystem is active\n" "PowerPC" return 0 } ############################################################################### # # Name: doStart # # Description: Start the PowerPC print subsystem. # # Arguments: none # # Returns: 0 on SUCCESS # 1 on FAILURE # ################################################################################ doStart() { [[ "$VERBOSE_LOGGING" == "high" ]] && set -x # : Starting the spooler group, which includes : qdaemon, writesrv, and lpd daemons. # /usr/bin/startsrc -g spooler >> $LOG_FILE 2>&1 # : Check the status of PowerPC print subsystem # isRunning (( $? == 0 )) && { KLIB_SA_logmsg INFO 3 3 print_server_sa.cat "%1\$s print subsystem \ started\n" "PowerPC" return 0 } KLIB_SA_logmsg INFO 3 4 print_server_sa.cat "%1\$s print subsystem \ unable to start\n" "PowerPC" 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 11 "# POWERPC PRINT SUBSYSTEM START LOG" >> $LOG_FILE echo "\n######################################################" >> $LOG_FILE # : Find out PowerPC print subsystem is active or not # isRunning (( $? == 1 )) && { KLIB_SA_logmsg INFO 3 5 print_server_sa.cat "Starting %1\$s print subsystem\n" "PowerPC" # : PowerPC print subsystem is not active. : Make an attempt to start PowerPC print subsystem. # doStart exit $? } exit 0