Queue depth start-up script for HP-UX

Open-Systems Host Attachment Guide

Version
9.8.7
Audience
anonymous
Part Number
MK-90RD7037-31

The queue (or hitachi_q) start-up script sets the queue depth to 8 for all new volumes (SCSI disk devices) on the storage system each time the HP-UX system restarts. If the queue script exists for a previously installed storage system, check the script file to verify that the queue depth value is set to the desired value, and add a line for each new volume. If the script does not exist, create and register the script as shown in the example below. You can use the UNIX vi editor or other text editor to create or edit the script.

Note: For questions about creating and registering the start-up script, refer to the UNIX and HPE user documentation, or ask your Hitachi Vantara representative for assistance.
# cp /sbin/init.d/template /sbin/init.d/queue 
# vi /sbin/init.d/queue
--------------------------file(/sbin/init.d/queue)----------------------
# !/sbin/sh
#
# @(#) $Revision: 78.1 $
# 
# NOTE:    This script is not configurable!  Any changes made to this
#          script will be overwritten when you upgrade to the next
#          release of HP-UX.
#
# WARNING: Changing this script in any way may lead to a system that
#          is unbootable.  Do not modify this script.
#
# <Insert comment about your script here>
#
# Allowed exit values:
#	0 = success; causes "OK" to show up in checklist.
#	1 = failure; causes "FAIL" to show up in checklist.
#	2 = skip; causes "N/A" to show up in the checklist.
#           Use this value if execution of this script is overridden
#	    by the use of a control variable, or if this script is not
#	    appropriate to execute for some other reason.
#       3 = reboot; causes the system to be rebooted after execution.
# Input and output:
#       stdin is redirected from /dev/null
#       stdout and stderr are redirected to the /etc/rc.log file
#       during checklist mode, or to the console in raw mode.

PATH=/usr/sbin:/usr/bin:/sbin
export PATH

# NOTE: If your script executes in run state 0 or state 1,then /usr
#      might not be available.  Do not attempt to access commands or
#      files in /usr unless your script executes in run state 2 or
#      greater.  Other file systems typically not mounted until run
#      state 2 include /var and /opt.

rval=0

# Check the exit value of a command run by this script.  If non-zero,
# the exit code is echoed to the log file and the return value of this
# script is set to indicate failure.
set_return()  {
       x=$?
       if [ $x -ne 0 ]; then
              echo "EXIT CODE: $x"
              rval=1 # script FAILed
       fi
}
# Kill the named process(es).
# $1=<search pattern for your process>

killproc()  {
       pid='ps -el | awk '( )$NF ~ /'"$1"'/) && ($4 !=mypid) && ($5 !=
mypid)  ){ print $4 }' mypid=$$ '
       if [ "X$pid" != "X" ]; then
              if kill "$pid"; then
                     echo "$1 stopped"
              else
                     rval=1
                     echo "Unable to stop $1"
              fi
       fi
}

case $1 in
'start_msg')
        # Emit a _short_ message relating to running this script with
        # the "start" argument; this message appears as part of the
        # checklist.
        echo "Setting the queue value"
        ;;
'stop_msg')
       # Emit a _short_ message relating to running this script with
       # the "stop" argument; this message appears as part of the
       # checklist.
       echo "Stopping the <specific> system"
       ;;

'start')
__________________________________________________________________
       # source the system configuration variables                |
       if [ -f /etc/rc.config ] ; then                            |
              . /etc/rc.config                                    |
       else                                                       |
              echo "ERROR: /etc/rc.config defaults file MISSING"  |
       fi                                                         |
                                                                  |
       # Check to see if this script is allowed to run...         |
       if [ "$CONTROL_VARIABLE" != 1 ]; then                      |
              rval=2                                              |
       else                                                       |
                                                                  |
       # Execute the commands to stop your system                 |
       :                                                          |
       fi                                                         |

       /usr/sbin/scsictl -m queue_depth=8 /dev/rdsk/c0t6d0
       /usr/sbin/scsictl -m queue_depth=8 /dev/rdsk/c0t6d1
       /usr/sbin/scsictl -m queue_depth=8 /dev/rdsk/c0t8d0
        :
       ;;
'stop')
       # source the system configuration variables
       if [ -f /etc/rc.config ] ; then
              . /etc/rc.config
       else
              echo "ERROR: /etc/rc.config defaults file MISSING"
       fi

       # Check to see if this script is allowed to run...
       if [ "$CONTROL_VARIABLE" != 1 ]; then
              rval=2
       else
        :
       # Execute the commands to stop your system

       fi
       ;;
*)
       echo "usage: $0 {start|stop|start_msg|stop_msg}"
       rval=1
       ;;
esac
exit $rval
--------------------------end of file(/sbin/init.d/queue)---------------------

# ls /sbin/rc1.d
K230audio       K340xntpd   K420dfs         K475rarpd       K630named      S420set_date
K240auditing    K356vjed    K430dce         K480rdpd        K660net        S440savecore
K250envd        K358egcd    K435OspfMib     K490gated       K700nettl      S500swap_start
K258diagnostic  K360kks     K435SnmpHpunix  K500inetd       K770ptydaemon  S520syncer
K270cron        K370vt      K435SnmpMib2    K510mrouted     K780syslogd
K278pd          K380xfs     K440SnmpMaster  K570nfs.client  K900swagentd
K280lp          K390rbootd  K450ddfa        K580nis.client  S100localmount
K290hparray     K400iforls  K460sendmail    K590nis.server  S320hostname
K300acct        K410ncs     K470rwhod       K600nfs.core    S400set_prvgrp

# ln -s /sbin/init.d/queue /sbin/rc1.d/S890queue