HP-UX Virtual Partitions

   

HP-UX Virtual Partitions

By Marty Poniatowski

Table of Contents
Chapter 8.  System Startup and Shutdown Scripts

Let's take a look at /etc/rc.config.d,where the configuration variable scripts are located to see what vPar-related scripts exist (please see the non-vPar-specific section of this chapter if need information on how HP-UX startup and shutdown operates.) We'll perform a long listing of this directory and search for vpar:

# ll /etc/rc.config.d | grep vpar -r--r--r-- 1 bin bin 291 Aug 21 14:38 vpard -r--r--r-- 1 bin bin 399 Aug 13 14:31 vparhb -r--r--r-- 1 bin bin 702 Aug 13 14:30 vparinit #

This listing shows three vPar-related configuration variable scripts. We 'll focus on vparhb the heartbeat daemon.

The heartbeat deamon is used to synchronize the Virtual Partition database every few seconds among the vPars running on a server. Modifications you make related to Virtual Partitions update the Virtual Partition database /stand/vpdb. The following listing shows the contents of /stand in a Virtual Partition:

# ll /stand total 143232 -rw-r--r-- 1 root sys 19 Jul 13 15:04 bootconf drwxr-xr-x 4 root sys 2048 Sep 17 15:47 build drwxrwxrwx 5 root root 1024 Sep 17 15:52 dlkm drwxrwxrwx 5 root sys 1024 Sep 17 14:10 dlkm.vmunix.prev -rw-r--r-- 1 root sys 3388 Sep 26 13:01 ioconfig -r--r--r-- 1 root sys 82 Jul 13 15:34 kernrel drwxr-xr-x 2 root sys 1024 Sep 26 13:04 krs drwxr-xr-x 2 root root 1024 Sep 26 13:01 krs_lkg drwxr-xr-x 2 root root 1024 Sep 26 13:04 krs_tmp drwxr-xr-x 2 root root 8192 Jul 13 15:04 lost+found -rw------- 1 root root 12 Sep 26 13:01 rootconf -r--r--r-- 1 root sys 2035 Sep 17 14:09 system -r--r--r-- 1 root sys 994 Jul 13 15:28 system.01 -r--r--r-- 1 root sys 999 Jul 13 15:56 system.02 -r--r--r-- 1 root sys 994 Jul 13 15:28 system.base drwxr-xr-x 2 root sys 1024 Jul 13 15:37 system.d -r--r--r-- 1 root sys 2030 Sep 17 14:07 system.prev -rwxr-xr-x 1 root root 22682568 Sep 17 15:52 vmunix -rwxr-xr-x 1 root sys 21916712 Sep 17 14:10 vmunix.prev -rw------- 1 root root 8232 Sep 26 13:01 vpdb -rw------- 1 root root 8232 Jul 17 14:11 vpdb.OLD -r-xr-xr-x 1 bin bin 837616 Aug 31 18:59 vpmon -rw------- 1 root root 5078504 Jul 18 11:36 vpmon.dmp # #

Among the files shown in this listing is vpdb. If this vpdb were to be modified, or another vpdb on this server were to be modified, the heartbeat daemon vphb would ensure that all of the databases on the server in all of the running vPars would be synchronized. The non-running vPars cannot be synchronized until they are started.

The heartbeat daemon vphb is shown in the following ps -ef listing:

# ps -ef | grep vphb root 352 1 0 13:01:53 ? 0:00 vphbd -d 10 -p /var/run/vphbd.pid root 7289 7232 1 12:18:28 pts/0 0:00 grep vphb #

vphb is started automatically as part of the startup structure of HP-UX. The following lisitng shows all of the links in /sbin/rc0.d, for run level zero, including the two vPar-related links at the very beginning of this listing:

# ll /sbin/rc0.d total 0 lrwxr-xr-x 1 bin bin 18 Sep 17 14:11 K425vpard -> /sbin/init.d/vpard lrwxr-xr-x 1 bin bin 19 Sep 17 14:11 K431vparhb -> /sbin/init.d/vparhb lrwxr-xr-x 1 root root 19 Jul 13 15:08 K480syncer -> /sbin/init.d/syncer lrwxr-xr-x 1 root root 15 Jul 13 15:08 K650kl -> /sbin/init.d/kl lrwxr-xr-x 1 root root 20 Jul 13 15:08 K800killall -> /sbin/init.d/killall lrwxr-xr-x 1 root root 19 Jul 13 15:08 K888kminit -> /sbin/init.d/kminit lrwxr-xr-x 1 root root 20 Jul 13 15:08 K890kmbuild -> /sbin/init.d/kmbuild lrwxr-xr-x 1 root root 23 Jul 13 15:08 K900localmount -> /sbin/init.d/localmount #

These are kill scripts, as indicated by the "K" preceding each link. The links to the start scripts are found in /sbin/rc1.d.

We 'll take a look at the file /sbin/init.d/vparhb that is shown in the heartbeat link and that is run at startup in the following listing:

# cat /sbin/init.d/vparhb #!/sbin/sh # # 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. # # # vphbd startup: Startup and kill script for the virtual partition # heartbeat daemon # PATH=/sbin:/usr/sbin:/usr/bin export PATH if [ -r /etc/rc.config.d/vparhb ] then . /etc/rc.config.d/vparhb fi case "$1" in 'start_msg') echo "Starting Virtual Partition Heartbeat Daemon" ;; 'start') vphbd -d "${VPHBD_DELAY-10}" -p "${VPHBD_PID_FILE-/var/run/vphbd.pid}" exit $? ;; 'stop_msg') echo "Stopping Virtual Partition Heartbeat Daemon" ;; 'stop') [ ! -r "${VPHBD_PID_FILE=/var/run/vphbd.pid}" ] && exit 2 pid=`cat "$VPHBD_PID_FILE"` [ "$pid" -le "0" ] && exit 1 kill "$pid" rm -f "$VPHBD_PID_FILE" exit 0 ;; *) echo "Usage: $0 { start | start_msg | stop | stop_msg }" ;; esac exit 0 #

Note that all of the start and stop information related to the heartbeat daemon is present in this file because this script is run for both kill (K) and start (S.)

The vPar-specific startup and shutdown setup, such as the heartbeat daemon we just covered, are automatically performed for you when vPars software is installed. Your application-related startup configuration must be performed on each vPar just as it would on separate servers.

The remainder of this chapter covers background information related to startup and shutdown of vPars.


       
    Top
     

    Категории