Article View: vmsnet.sources
Article #28PBS Startup Examples, part 01/02
From: sdroppers
Date: Thu, 06 Aug 1992 13:44
Date: Thu, 06 Aug 1992 13:44
1398 lines
50950 bytes
50950 bytes
Submitted-by: sdroppers@pbs.org
Posting-number: Volume 3, Issue 104
Archive-name: startup_file_examples/part01
These are some of the files used at PBS in the startup of our system.
This is NOT the complete set of files, and has NOT been modified for
movement to other systems. You will need to look at the code and
customize it for your site.
Warning!!
Use this at your own risk, this has not been set up for any system
other than PBS, and has NOT been documented well!
--
Seton Droppers -- "Anything that I say is my opinion and not my employer's."
Systems Manager, E-Mail Postmaster
Public Broadcasting Service, 1320 Braddock Place Alexandria, VA 22314-1698
E-Mail: sdroppers@pbs.org Voice: 703-739-5089 FAX: 703-739-0775
$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.2-007 22-FEB-1990
$! On 28-JUL-1992 13:16:12.64 By user SDROPPERS
$!
$! This VMS_SHARE Written by:
$! Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$! James Gray - Original VMS_SHARE
$! Michael Bednarek - Original Concept and implementation
$!
$!+ THIS PACKAGE DISTRIBUTED IN 2 PARTS, TO KEEP EACH PART
$! BELOW 100 BLOCKS
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE ( @name )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$! 1. AAAREADME.1ST;1
$! 2. PBS_COMMON_LOGICALS.COM;4
$! 3. PBS_CREATE_COMMON_ENVIRONMENT.COM;8
$! 4. PBS_DEFINE_LOGICAL_NAMES.COM;2
$! 5. PBS_EXECUTE_PROCEDURE.COM;2
$! 6. PBS_LPBEGIN.DAT;1
$! 7. PBS_LPMAIN.DAT;1
$! 8. PBS_MOUNT_PAGESWAP.COM;3
$! 9. PBS_MOUNT_SHADOW_DISKS.COM;4
$! 10. PBS_PAGESWAP_FILES.DAT;2
$! 11. PBS_SHADOW_DISKS.DAT;3
$! 12. PBS_STARTUP_DRIVER_LPBEGIN.COM;2
$! 13. PBS_STARTUP_DRIVER_LPMAIN.COM;2
$! 14. PBS_STARTUP_DRIVER_SYSTARTUP.COM;2
$! 15. PBS_SYPAGSWPFILES_EXTENDED.DAT;3
$! 16. SYPAGSWPFILES.COM;13
$!
$set="set"
$set symbol/scope=(nolocal,noglobal)
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
"output_file"));ENDPROCEDURE;Unpacker;QUIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create 'f'
XThese are some of the files used at PBS in the startup of our system. This
V is
XNOT the complete set of files, and has NOT been modified for movement to oth
Ver
Xsystems. You will need to look at the code and customize it for your site.
X
XWarning!!
X
XUse this at your own risk, this has not been set up for any system other tha
Vn
XPBS, and has NOT been documented well!
X
XSeton R. Droppers
XComputer Services
XPublic Broadcasting Service
X1320 Braddock Place
XAlexandria, VA 22314
X
Xdroppers@pbs.org
X703-739-5089
$ CALL UNPACK AAAREADME.1ST;1 107817014
$ create 'f'
X$!==========================================================================
V====
X$!NAME: PBS_COMMON_LOGICALS.COM
X$!
X$!PROJECT/FACILITY: PBS Common Startup
X$!
X$!AUTHOR(S):`09 Seton R. Droppers / System Manager
X$!`09`09 Public Broadcasting Service / Computer Services
X$!`09`09 1320 Braddock Place
X$!`09`09 Alexandria, VA 22314-1698
X$!`09`09 (703) 739-5100
X$!
X$!CREATION DATE: 15-MAR-1991 14:19:49.34
X$!
X$! Copyright 1991. Public Broadcasting Service. All rights reserved.
X$!
X$! This software is furnished for the purpose of example only. While PBS
X$! does not object to others copying or using the software, provided the
X$! above copyright notice is placed on any copies made, PBS disclaims any
X$! responsibility and liability for the suitability, reliability or use o
Vf
X$! the software for any purpose. Any user of this software will be solely
X$! responsible for its use.
X$!
X$!
X$!FUNCTIONAL DESCRIPTION:
X$!
X$! Command procedure to create the PBS_COMMON and PBS_CMN logicals.
X$!
X$!PARAMETERS:
X$!
X$! None
X$!
X$!==========================================================================
V====
X$ set NOon
X$ defsys := define/sys/exec/NOlog
X$ defroot := define/system/exec/NOlog/translation_attributes=concealed
X$ `20
X$ defsys pbs_common`09 pbssys1:`5Bpbs_common`5D
X$ defroot pbs_cmn`09 pbssys1:`5Bpbs_common.`5D
X$ defsys pbs_cmn_bin`09 pbs_cmn:`5Bbin`5D
X$ defsys pbs_cmn_log`09 pbs_cmn:`5Blog`5D
X$ defsys pbs_cmn_data pbs_cmn:`5Bdata`5D
X$ defsys pbs_cmn_cmslib pbs_cmn:`5Bcmslib`5D
X$ defsys pbs_cmn_work pbs_cmn:`5Bwork`5D
X$
X$ exit
X$!==========================================================================
V====
X$! DEC/CMS REPLACEMENT HISTORY, Element PBS_COMMON_LOGICALS.COM
X$! *1 15-MAR-1991 14:48:17 SDROPPERS "Command procedure to set up logical
Vs for PBS_COMMON area"
X$! DEC/CMS REPLACEMENT HISTORY, Element PBS_COMMON_LOGICALS.COM
$ CALL UNPACK PBS_COMMON_LOGICALS.COM;4 789790774
$ create 'f'
X$!==========================================================================
V====
X$!NAME: PBS_CREATE_COMMON_ENVIRONMENT.COM
X$!
X$!PROJECT/FACILITY: PBS Common Startup
X$!
X$!AUTHOR(S):`09 Seton R. Droppers / System Manager
X$!`09`09 Public Broadcasting Service / Computer Services
X$!`09`09 1320 Braddock Place
X$!`09`09 Alexandria, VA 22314-1698
X$!`09`09 (703) 739-5100
X$!
X$!CREATION DATE: 12-MAR-1991 13:58:03.14
X$!
X$! Copyright 1991. Public Broadcasting Service. All rights reserved.
X$!
X$! This software is furnished for the purpose of example only. While PBS
X$! does not object to others copying or using the software, provided the
X$! above copyright notice is placed on any copies made, PBS disclaims any
X$! responsibility and liability for the suitability, reliability or use o
Vf
X$! the software for any purpose. Any user of this software will be solely
X$! responsible for its use.
X$!
X$!
X$!FUNCTIONAL DESCRIPTION:
X$!
X$! This command procedures mounts the system disks and the disk PBSSYS1. I
Vt
X$! then executes two command procedures (from the common area) to set up th
Ve
X$! basic structures.
X$!
X$! This command procedure is called as a local modification to the startup
X$! procedure SYPAGSWPFILES.COM. It is very important that this command
X$! procedure be called from SYPAGSWPFILES since the Configure process must
V be
X$! running for the HSC devices to be seen.
X$!
X$! This command procedure makes use of two internal CALLed subroutines, HSC
VMNT
X$! and DEVWAIT. Use of these procedures keeps the structure clearer. The
X$! basic flow of the procedure is to mount PBSSYS1 and then to execute a
X$! command procedure that resides on PBSSYS1. While it is very tempting to
X$! mount more than one disk during this procedure remember that this partic
Vular
X$! procedure resides in multiple physical areas, all of which must be
X$! coordinated. By only mounting PBSSYS1 with this procedure the problems
V of
X$! keeping all systems coordinated are reduced.
X$!
X$! The internal subroutine HSCMNT handles the logic needed to mount a shado
Vw
X$! set, see documentation in that routine for parameters needed, etc. HSCM
VNT
X$! is called once for each disk that is mounted.
X$!
X$! The internal subroutine DEVWAIT handles waiting for the CONFIGURE proces
Vs to
X$! configure HSC devices. DEVWAIT is called once for each physical device
V that
X$! is required for a shadow set to be mounted. DEVWAIT requires a single
X$! parameter, the physical device to wait for. DEVWAIT is called from with
Vin
X$! HSCMNT.
X$!
X$!PARAMETERS:
X$!
X$! None
X$!
X$!==========================================================================
V====
X$ !+
X$ ! The first thing that get done is to set up a number of symbols that ar
Ve
X$ ! used in the remainder of the procedure. These are done to simplify th
Ve
X$ ! structure of the actual command procedure.
X$ !-
X$ set NOon
X$ mumble_debug := "FALSE"
X$ say := "Write sys$output"
X$ mumble := "If mumble_debug then $write sys$output"
X$ !
X$ pcdnam`09= F$Parse( F$Environment( "PROCEDURE" ),,,"NAME" )
X$ !+
X$ ! Set up message strings
X$ !-
X$ hsc_novollab = "%!AS-F-NOVOLLAB, HSCMNT: Missing P1, volume label"
X$ hsc_noshadev = "%!AS-F-NOSHADEV, HSCMNT: Missing P2, Shadow device"
X$ hsc_nophys`09 = "%!AS-F-NOPHYS, HSCMNT: Missing P3, Physical Device"
X$ hsc_attmou1`09 = "%!AS-I-ATTMOU1, HSCMNT: Attempting to mount device
V " +-
X`09`09`09"!AS, label !AS, using physical device !AS"
X$ hsc_attmou2`09 = "%!AS-I-ATTMOU2, HSCMNT: Attempting to mount device
V " +-
X`09`09`09"!AS, label !AS, using physical devices !AS and !AS"
X$ devwait_waiting = "%!AS-I-WAITING, DEVWAIT: Wating for device !AS to con
Vfigure"
X$ devwait_waitexpire`09= "%!AS-F-WAITEXPIRE, DEVWAIT: Wait for device !AS
V expired"
X$ hsc_mounting = "%!AS-I-MOUNTING, HSCMNT: Mounting device !AS, label !
VAS"
X$ hsc_alreamou = "%!AS-I-ALREAMOU, HSCMNT: Device !AS already mounted"
X$ !
X$ If mumble_debug then $ show sym/local *
X$ !-----------------------------------------------------------------------
V----
X$ ! Now the actual work gets going!
X$ !-----------------------------------------------------------------------
V----
X$ !+
X$ ! IMPORTANT!
X$ !`09Name of file to run to set up logical names! This is defined as
X$ !`09a string symbol so that in only needs to be changed once, even thoug
Vh
X$ !`09it is used in two places.
X$ !-
X$ pbs_common_logicals`09= "PBSSYS1:`5BPBS_COMMON.BIN`5DPBS_COMMON_LOGICALS
V.COM"
X$ !+
X$ ! Mount only PBSSYS1. This reduces the problems keeping shadow sets
X$ ! together.
X$ !-
X$ call hscmnt pbssys1 $1$dus2: $1$dua2: $1$dua5:
X$ !+
X$ ! Now go out and execute the logical name setup procedure for the base
X$ ! logicals
X$ !-
X$ If F$Search( PBS_COMMON_LOGICALS ) .NES. ""
X$ Then
X$`09!+
X$`09! The file was found, we can go and execute it
X$`09!-
X$`09@'PBS_COMMON_LOGICALS'
X$ Else
X$`09!+
X$`09! The file was not found, print a big message out (should go
X$`09! to the console) so someone can see it
X$`09!-
X$`09Say "*************************************************"
X$`09Say ""
X$`09Say "WARNING!!
X$`09Say "PBS COMMON Startup unable to find files to set common"
X$`09Say "Area up. This cluster member will only boot"
X$`09Say "with local files. This includes only the local"
X$`09Say "SYSUAF.DAT and similar files."
X$`09Say ""
X$`09Say "*************************************************"
X$ EndIf
X$exit:
X$ saved_status = 1
X$ goto final_exit
X$error_exit:
X$ saved_status = $status
X$ goto final_exit
X$final_exit:
X$ exit saved_status
X$ `20
X$!==========================================================================
V====
X$!>>>>>>>>>>>>>>>> SUBROUTINE hscmnt <<<>>> SUBROUTINE hscmount <<<<<<<<<<<<
V<<<<
X$!==========================================================================
V====
X$hscmnt: SUBROUTINE !Internal CALLed subroutine
X$
X$! Procedure to mount a cluster disk
X$!
X$! Params:
X$!
X$! p1 - Volume Label of disk pack
X$! p2 - Shadow device spec
X$! p3 - First physical device to mount for shadow set
X$! p4 - Second physical device to mount for shadow set (optional)
X$!
X$! Recommended use:
X$!
X$! This procedure is an internal routine
X$!
X$!`09$ call hscmnt vaxvms_a $1$dus0: $1$dua0: $1$dua1:
X$!`09$ call hscmnt test1 $1$dus108: $1$dua5:
X$!--------------------------------------------------------------------------
V----
X$ If P1 .EQS. ""
X$ Then
X$`09say F$Fao( hsc_novollab, pcdnam )
X$`09hscmnt_saved_status = 44
X$`09goto hscmnt_exit
X$ EndIf
X$
X$ If P2 .EQS. ""
X$ Then
X$`09Say F$Fao( hsc_noshadev, pcdnam )
X$`09hscmnt_saved_status = 44
X$`09goto hscmnt_exit
X$ Endif
X$
X$ If P3 .EQS. ""
X$ Then
X$`09Say F$Fao( hsc_nophys, pcdnam )
X$`09hscmnt_saved_status = 44
X$`09goto hscmnt_exit
X$ EndIf
X$
X$ call devwait "''P3'"
X$ If P4 .NES. ""
X$ Then
X$`09call devwait "''P4'"
X$ EndIf
X$
X$ !+
X$ ! The following checks if P4 exists or not and builds the appropriate
X$ ! shadow qualifier (one or two devices)
X$ !-
X$ If P4 .EQS. ""
X$ Then
X$`09shadow_qualifier = "/shadow=( ''P3' )"
X$`09Say F$Fao( hsc_attmou1, pcdnam, p2, p1, p3 )
X$ Else
X$`09shadow_qualifier = "/shadow=( ''P3', ''P4' )"
X$`09Say F$Fao( hsc_attmou2, pcdnam, p2, p1, p3, p4 )
X$ EndIf
X$ mumble "hscmnt: Shadow qualifier is: ''shadow_qualifier'"
X$
X$ !+
X$ ! Now mount the disk. The disk is mounted cluster wide, and without
X$ ! any quota.
X$ !-
X$ mount -
X`09/system -
X`09/NOquota -
X`09 'P2' 'shadow_qualifier' -
X`09`09'P1' 'P1'
X$
X$ hscmnt_saved_status = $status
X$ goto hscmnt_exit
X$
X$hscmnt_exit:
X$ exit hscmnt_saved_status
X$ endsubroutine
X$
X$!==========================================================================
V====
X$!>>>>>>>>>>>>>>>> SUBROUTINE devwait <<<>>> SUBROUTINE devwait <<<<<<<<<<<<
V<<<<
X$!==========================================================================
V====
X$
X$devwait: SUBROUTINE`09! Subroutine to wait for a device
X$
X$! Procedure to wait for the CONFIGURE process to configure an HSC device
X$!
X$! The procedure will loop, checking for the existance of the desired device
V.
X$! This looping is required since the CONFIGURE process may not have configu
Vred
X$! the device by the time this procedure is running.
X$!
X$! Params:
X$!
X$! p1 - Device to wait for
X$!
X$! Recommended use:
X$!
X$! This procedure is an internal routine
X$!
X$!`09$ call devwait $1$DUA0:
X$!--------------------------------------------------------------------------
V----
X$ wait_count`09= 0
X$devwait_again:
X$ if f$getdvi("''p1'","EXISTS") then goto devwait_exists
X$ wait_count = wait_count + 1
X$ if wait_count .gt. 10 then goto devwait_give_up
X$ Say F$Fao( devwait_waiting, pcdnam, p1 )
X$ wait 00:00:10.00 ! Wait 10 seconds
X$ goto devwait_again
X$devwait_give_up:
X$ Say F$Fao( devwait_waitexpire, pcdnam, p1 )
X$ devwait_saved_status = 44
X$ goto devwait_exit
X$
X$devwait_exists:
X$ devwait_saved_status = 1
X$ goto devwait_exit
X$ `20
X$devwait_exit:
X$ exit devwait_saved_status
X$ endsubroutine
X$
X$===========================================================================
V===
X$! DEC/CMS REPLACEMENT HISTORY, Element PBS_CREATE_COMMON_ENVIRONMENT.COM
X$! *4 27-MAR-1991 07:36:36 SDROPPERS "Fixed to only mount on local node a
Vnd to do a mount_verify when the disk is mounted"
X$! *3 18-MAR-1991 10:29:49 SDROPPERS "Added DUA5 to DUS2"
X$! *2 15-MAR-1991 14:59:18 SDROPPERS "Fixed problem with check for logica
Vls file"
X$! *1 15-MAR-1991 14:49:05 SDROPPERS "Command procedure to create PBS com
Vmon environment"
X$! DEC/CMS REPLACEMENT HISTORY, Element PBS_CREATE_COMMON_ENVIRONMENT.COM
$ CALL UNPACK PBS_CREATE_COMMON_ENVIRONMENT.COM;8 825912144
$ create 'f'
X$!==========================================================================
V====
X$!NAME: PBS_DEFINE_LOGICAL_NAMES.COM
X$!
X$!PROJECT/FACILITY: PBS Common Utilities
X$!
X$!AUTHOR(S):`09 Seton R. Droppers / System Manager
X$!`09`09 Public Broadcasting Service / Computer Services
X$!`09`09 1320 Braddock Place
X$!`09`09 Alexandria, VA 22314-1698
X$!`09`09 (703) 739-5100
X$!
X$!CREATION DATE: 3-APR-1991 09:42:41.52
X$!
X$! Copyright 1992. Public Broadcasting Service. All rights reserved.
X$!
X$! This software is furnished for the purpose of example only. While PBS
X$! does not object to others copying or using the software, provided the
X$! above copyright notice is placed on any copies made, PBS disclaims any
X$! responsibility and liability for the suitability, reliability or use o
Vf
X$! the software for any purpose. Any user of this software will be solely
X$! responsible for its use.
X$!
X$!FUNCTIONAL DESCRIPTION:
X$!
X$! This command procedure defines logical names in the system logical name
X$! table. In the future it is expected that this procedure will be expande
Vd to
X$! provide not only system logical names but the ability to create other
X$! logical name tables and to populate the created logical name table as we
Vll.
X$!
X$!PARAMETERS:
X$!
X$! P1 (Required) A data file containing logical name specifications. Eac
Vh
X$! record (line) of the data file specifies a single logical name to be
X$! created. Each data entry is parsed using the F$Edit lexical function to
X$! remove unneeded whitespace and to remove any DCL comments. If case or
X$! spacing is critical in a field be sure to enclose that field in double q
Vuote
X$! characters. (The quote characters are ignored in parsing for the "`7C"
X$! character, however.)
X$!
X$! Each record consists of multiple fields, each field being separated by a
X$! vertical bar ("`7C") character. The all other fields depends on the con
Vtents
X$! of the first field.
X$!
X$!ACTIONS:
X$!
X$! Actions are based on the contents of the first field. Valid directives
V are:
X$!
X$! DEVICE -- Define a logical device
X$! SYSTEM -- Define a system logical name
X$!
X$! DEVICE:
X$!`09Define a logical name that is used to point to a device. This is used
X$!`09to define a system level logical name in executive mode. The device th
Ve
X$!`09logical name points to is parsed to obtain the physical name of the
X$!`09device and then checked to see if it exists. If the physical device
X$!`09does not exist then the NULL device (NLA0:) is used instead and a
X$!`09message is printed.
X$!
X$!`09DEVICE `7C log_name `7C dev_spec
X$!
X$!`09 DEVICE`09`09Define a logical name to point to a device
X$!`09 log_name`09`09Logical name for the device
X$!`09 dev_spec`09`09Device specification (may be a logical name)
X$!
X$! SYSTEM:
X$!`09Define a logical name in the system logical name table. This requires
X$!`09SYSNAM privilege. The use of the fields is as follows:
X$!
X$!`09SYSTEM `7C log_name `7C equ_str `7C `5Bmode`5D `7C `5Bname_att`5D `7C `
V5Btran_att`5D
X$!
X$!`09If neither of the optional fields is included the field separator
X$!`09characters for the optional fields may be left off as well.
X$!
X$!`09 SYSTEM`09`09Define a SYSTEM logical name
X$!`09 log_name`09`09The logical name to define
X$!`09 equ_str`09`09The string the logical name equivalences to
X$!`09 mode`09`09Mode to define logical in
X$!`09 name_att`09`09Name_Attribuites qualifier contents
X$!`09 tran_att`09`09Translation_Attributes qualifier contents
X$!
X$!`09 Example:`09SYSTEM`7Ctest01`7Ctest_disk:`5Btest_dir`5D`7Cexec`7Cno_a
Vlias`7Cconcealed
X$!`09`09`09SYSTEM`7Ctest02`7Ctest_disk:`5Btest02
X$!
X$!==========================================================================
V====
X$!--------------------------------------------------------------------------
V----
X$! Local Subroutines are declared here (to avoid problems with IF-ENDIF and
V goto
X$!
X$! This section is skipped with the GOTO START_WORK command
X$!--------------------------------------------------------------------------
V----
X$ goto start_work
X$!--------------------------------------------------------------------------
V----
X$define_device:
X$ !+
X$ ! GoSub Subroutine to define a device logical name
X$ !-
X$ mumble "Entering DEFINE_DEVICE"
X$ spec_log = F$Element( fld_log, fs, data_rec ) - fs
X$ spec_equ = F$Element( fld_equ, fs, data_rec ) - fs
X$ mumble "Line ''Line_count': Log: " + spec_log
X$ mumble "Line ''Line_count': Equ: " + spec_equ
X$ mumble "Exiting DEFINE_DEVICE"
X$ device_name`09= F$Parse( "''spec_equ'","NLA0:" , , "DEVICE", "NO_CONCEAL
V" )
X$ set NOon
X$ define -
X`09/system -
X`09/executive -
X`09/NOlog -
X`09/name_attributes = no_alias -
X`09/translation_attributes`09= ( concealed,terminal ) -
X`09 'spec_log' 'device_name'
X$ set On
X$ if device_name .EQS. "NLA0:" then`09$ goto define_sysdev_nulltarget
X$ goto define_system_device_end
X$define_sysdev_nulltarget:
X$ SayMsg "Line ''Line_count': Device ''spec_equ' not found, NLA0: used"
X$ !
X$define_system_device_end:
X$ return 1
X$!
X$!--------------------------------------------------------------------------
V----
X$define_system:
X$ !+
X$ ! GoSub Subroutine to define a system logical name
X$ !-
X$ mumble "Entering DEFINE_SYSTEM"
X$
X$ spec_log = F$Element( fld_log, fs, data_rec ) - fs
X$ spec_equ = F$Element( fld_equ, fs, data_rec ) - fs
X$ spec_mod = F$Element( fld_mod, fs, data_rec ) - fs
X$ spec_nam = F$Element( fld_nam, fs, data_rec ) - fs
X$ spec_tra = F$Element( fld_tra, fs, data_rec ) - fs
X$ If( mumble_debug )
X$ Then
X$`09mumble "Line ''Line_count': Log: " + spec_log
X$`09mumble "Line ''Line_count': Equ: " + spec_equ
X$`09mumble "Line ''Line_count': Mod: " + spec_mod
X$`09mumble "Line ''Line_count': Nam: " + spec_nam
X$`09mumble "Line ''Line_count': Tra: " + spec_tra
X$ EndIf
X$ do_define`09= "TRUE"
X$ If( spec_log .EQS. "" )
X$ Then
X$`09SayErr "Line ''Line_count': Logical name not specified"
X$`09do_define = "FALSE"
X$ EndIf
X$
X$ If( spec_equ .EQS. "" )
X$ Then
X$`09SayErr "Line ''Line_count': Equivalence string not specified"
X$`09do_define = "FALSE"
X$ EndIf
X$
X$ If( spec_mod .EQS. "" )
X$ Then
X$`09qual_mod = ""
X$ Else
X$`09qual_mod = "/''spec_mod'"
X$ EndIf
X$
X$ If( spec_nam .EQS. "" )
X$ Then
X$`09qual_nam = ""
X$ Else
X$`09qual_nam = "/name_attributes = ( ''spec_nam' )"
X$ EndIf
X$
X$ If( spec_tra .EQS. "" )
X$ Then
X$`09qual_tra = ""
X$ Else
X$`09qual_tra = "/translation_attribuites=( ''spec_tra' )"
X$ EndIf
X$
X$ If( do_define )
X$ Then
X$`09set NOon
X$`09If mumble_debug then mum_verify = F$Verify(1)
X$`09define -
X`09 /system -
X`09 /log -
X`09 'qual_mod' -
X`09 'qual_nam' -
X`09 'qual_tra' -
X`09`09'spec_log' -
X`09`09'spec_equ'
X$`09If mumble_debug then mum_verify = F$Verify( mum_verify )
X$`09set On
X$ EndIf
X$ mumble "Exiting DEFINE_SYSTEM"
X$ return 1
X$!
X$!--------------------------------------------------------------------------
V----
X$no_action:
X$ !+
X$ ! GoSub Subroutine when no action has been defined
X$ !-
X$ mumble "Entering NO_ACTION"
X$ SayErr "Line ''line_count': Invalid Action Requested: ''req_action'"
X$ mumble "Exiting NO_ACTION"
X$ return 1
X$!--------------------------------------------------------------------------
V----
X$! Start procedure setup
X$!--------------------------------------------------------------------------
V----
X$START_WORK:
X$ on error then $ goto error_exit
X$ on control_y then`09$ goto control_y_exit
X$ save_verify = F$Verify(0)
X$ pcdnam = F$Parse( F$Environment( "PROCEDURE" ),,,"NAME")
X$ pcdid = pcdnam + " `5B''F$Getjpi( 0, "PID" )'`5D"
X$ mumble_debug := "FALSE"
X$ saymsg := "Write sys$output ""''pcdid': "" +"
X$ mumble := "If mumble_debug then $ Write sys$output ""''pcdid':
V . "" +"
X$ sayerr := "Write sys$output ""''pcdid': * "" +"
X$ mumble "Procedure Entry: ''F$Time()'"
X$!--------------------------------------------------------------------------
V----
X$! Local Symbols defined Here
X$!--------------------------------------------------------------------------
V----
X$ fs`09`09 = "`7C" ! Define field separator
X$ fld_act`09 = 0`09 ! Action field
X$ fld_log`09 = 1`09 ! Logical name field (DEVICE, SYSTEM)
X$ fld_equ`09 = 2`09 ! Equevalence field (DEVICE, SYSTEM)
X$ fld_mod`09 = 3`09 ! Mode to define logical with
X$ fld_nam`09 = 4`09 ! Name Attribute field (SYSTEM)
X$ fld_tra`09 = 5`09 ! Translation Attribuite field (SYSTEM)
X$
X$ valid_actions = "SYSTEM" + fs + "DEVICE"
X$ action_dispatch = "gosub define_system" + fs + "gosub define_device"
X$
X$ !+
X$ ! Build a symbol for our data file. This must be unique to this
X$ ! process and procedure depth to avoid problems with multiple invocation
Vs
X$ ! of the command procedure.
X$ !-
X$ data_file = "data_''F$Pid(0)'_''F$Environment( "DEPTH" )'"
X$
X$!--------------------------------------------------------------------------
V----
X$! Start main processing loop
X$!--------------------------------------------------------------------------
V----
X$
X$ !+
X$ ! Check if required parameter has been specified or not
X$ !-
X$ If ( P1 .NES. "" )
X$ Then
X$`09mumble "P1, File to process: ''P1'"
X$`09file_to_open = F$Parse( p1, ".DAT;0",,,"NO_CONCEAL" )
X$`09file_to_open = F$Search( file_to_open )
X$`09If (file_to_open .EQS. "") then $ goto no_file_to_open
X$`09SayMsg "Input from file: ''file_to_open' ''F$Time()'"
X$`09open -
X`09 /error = open_file_error -
X`09 /read -
X`09 /share -
X`09`09'data_file' -
X`09`09'file_to_open'
X$
X$`09!+
X$`09! Now set up a loop to read through the data file
X$`09!-
X$`09line_count = 0
X$`09read_loop:
X$`09 line_count = line_count + 1
X$`09 read -
X`09`09/end`09= eof_on_read -
X`09`09/error`09= read_error_handler -
X`09`09 'data_file' -
X`09`09 data_rec
X$`09 mumble "Line ''line_count': Contents: " + data_rec
X$`09 !+
X$`09 ! Now edit the line so that we can parse it
X$`09 !-
X$`09 data_rec`09= F$Edit( data_rec, "COLLAPSE,UPCASE,UNCOMMENT")
X$`09 If( data_rec .NES. "" )
X$`09 Then
X$`09`09!+
X$`09`09! Set up a decode loop, checking for valid actions
X$`09`09!-
X$`09`09req_action = F$Element( 0, fs, data_rec ) ! Get action request
X$`09`09decode_cnt = 0
X$`09`09req_dispatch = ""
X$`09`09mumble "Line ''line_count': Requested Action: ''req_action'"
X$`09`09decode_loop:
X$`09`09 possible_action = F$Element( decode_cnt, fs, valid_actions )
X$`09`09 mumble "Line ''line_count': Possible Action " + -
X`09`09`09 "''decode_cnt': ''possible_action'"
X$`09`09 If( possible_action .EQS. fs ) then`09$ goto decode_loop_done
X$`09`09 If( req_action .EQS. possible_action )
X$`09`09 Then
X$`09`09`09req_dispatch = F$Element( decode_cnt, fs, -
X`09`09`09`09`09 action_dispatch )
X$`09`09`09mumble "Line ''line_count': Requested action " + -
X`09`09`09`09"(''req_action') matched possible action " + -
X`09`09`09`09"(''possible_action')"
X$`09`09 EndIf
X$`09`09 !+
X$`09`09 ! Check if we actually dispatched, and if so then exit
X$`09`09 ! the loop. This is flagged by REQ_DISPATCH being set to
X$`09`09 ! a non-NULL string value
X$`09`09 !-
X$`09`09 If req_dispatch .NES. "" then $ goto decode_loop_done
X$`09`09 decode_cnt = decode_cnt + 1
X$`09`09 goto decode_loop
X$`09`09decode_loop_done:
X$`09`09!+
X$`09`09! Now dispatch to the desired action
X$`09`09!-
X$`09`09If( req_dispatch .NES. "" )
X$`09`09Then
X$`09`09 mumble "Line ''line_count': Dispatching Action: " + -
X`09`09`09`09 "''req_dispatch'"
X$`09`09 'req_dispatch'
X$`09`09Else
X$`09`09 GoSub no_action
X$`09`09EndIf
X$`09 Else
X$`09`09mumble "Line ''line_count': No entry"
X$`09 EndIf
X$`09 goto read_loop
X$`09read_error_handler:
X$`09 saved_status = $status
X$`09 SayErr "Line ''line_count': Error during read"
X$`09 SayErr "Error Returned: ''F$Message( saved_status )'"
X$`09 goto read_loop
X$`09read_loop_done:
X$`09eof_on_read:
X$`09close 'data_file'
X$`09final_exit = 1
X$ Else
X$`09SayErr "P1, File to process: *MISSING*"
X$`09final_exit = 44
X$ EndIf
X$ `20
X$exit:
X$ saved_status = 1
X$ goto final_exit
X$no_file_to_open:
X$ !+
X$ ! Specified file does not exist, tell user and abort
X$ !-
X$ SayErr "Cannot find file ''p1'"
X$ saved_status = 44
X$ goto final_exit
X$open_file_error:
X$ !+
X$ ! Unable to open file, post error
X$ !-
X$ saved_status = $status
X$ msg`09= F$Message( saved_status )
X$ SayErr "Unable to open file: ''file_to_open'"
X$ SayErr "Error Returned by OPEN: ''msg'"
X$ goto final_exit
X$control_y_exit:
X$ saved_status = 44
X$ SayErr "Aborting -- Control-y entered"
X$ goto final_exit
X$error_exit:
X$ saved_status = $status
X$ SayErr "Aborting -- Unknown error encountered"
X$ goto final_exit
X$final_exit:
X$ If( F$Trnlnm( data_file ) .NES. "" )
X$ Then
X$`09close 'data_file'
X$ EndIf
X$ mumble "Procedure Exit: ''F$Time()'"
X$ If F$Type( save_verify ) .EQS. "INTEGER" then $ junk = F$Verify( save_ve
Vrify)
X$ exit saved_status
X$!==========================================================================
V====
X$! DEC/CMS REPLACEMENT HISTORY, Element PBS_DEFINE_LOGICAL_NAMES.COM
X$! *1 15-APR-1991 11:33:19 SDROPPERS "Command procedure to define system
V level logical names"
X$! DEC/CMS REPLACEMENT HISTORY, Element PBS_DEFINE_LOGICAL_NAMES.COM
$ CALL UNPACK PBS_DEFINE_LOGICAL_NAMES.COM;2 1376284782
$ create 'f'
X$!==========================================================================
V====
X$!NAME: PBS_EXECUTE_PROCEDURE.COM
X$!
X$!PROJECT/FACILITY: PBS Common Startup
X$!
X$!AUTHOR(S):`09 Seton R. Droppers / System Manager
X$!`09`09 Public Broadcasting Service / Computer Services
X$!`09`09 1320 Braddock Place
X$!`09`09 Alexandria, VA 22314-1698
X$!`09`09 (703) 739-5100
X$!
X$!CREATION DATE: 5-APR-1991 10:22:26.96
X$!
X$! Copyright 1992. Public Broadcasting Service. All rights reserved.
X$!
X$! This software is furnished for the purpose of example only. While PBS
X$! does not object to others copying or using the software, provided the
X$! above copyright notice is placed on any copies made, PBS disclaims any
X$! responsibility and liability for the suitability, reliability or use o
Vf
X$! the software for any purpose. Any user of this software will be solely
X$! responsible for its use.
X$!
X$!
X$!FUNCTIONAL DESCRIPTION:
X$!
X$! This command procedure read records from the specified input file and
X$! executes the command procedures specified by the input in the specified
V way.
X$!
X$! The specified file consists of records, one record per line of the file.
X$! Each record consists of multiple fields, the fields being seperated by a
X$! vertical bar ("`7C") character. Each record consists of the following f
Vields:
X$!
X$! nodes `7C action `7C procedure_spec `7C p1 `7C ... `7C p8
X$!
X$! Where:
X$!`09nodes`09 Specifies the nodes to execute the procedure on
X$!
X$!`09action`09 Specifies how to execute the procedure (BATCH or DIRECT)
X$!
X$!`09procedure Specifies the procedure to execute (file name). If no
X$!`09`09 directory is specified then the directory specified by
X$!`09`09 PBS_CMN_BIN: is searched for the command procedure.
X$!
X$!`09p1...p8`09 Optional parameters to pass to the procedure
X$!
X$! DIRECT The procedure will be executed with the "@" command in line as p
Vart
X$!`09 of this procedure.
X$!
X$! BATCH The procedure will be executed as a batch procedure on the queue
X$!`09 specified with the symbol "EXECUTION_QUEUE". This procedure will
X$!`09 build this symbol from a node specific part (built from the F$GETSY
VI
X$!`09 lexical function) and a general part -- see code for details.
X$!
X$!`09 The procedure will also build the symbol EXECUTION_LOG and use this
X$!`09 as the log file location for the job.
X$!
X$!PARAMETERS:
X$!
X$! P1 (REQUIRED) The name of the file to read to get the command procedur
Ve
X$!`09`09 specifications from.
X$!
X$!`09`09 If no directory is specified the directory specified by
X$!`09`09 PBS_CMN_DATA: is searched.
X$!
X$!NOTE:
X$!
X$! To use the BATCH action the queue manager must be started and the
X$! appropriate queue must be defined. The data file can include a queue
X$! startup procedure executed with a DIRECT action followed by any number o
Vf
X$! BATCH procedures, if you wish.
X$!
X$!==========================================================================
V====
X$!--------------------------------------------------------------------------
V----
X$! Local Subroutines declared here (to avoid problems with VMS IF-ENDIF bug)
X$!
X$! This section is skipped with the following GOTO START_WORK command
X$!--------------------------------------------------------------------------
V----
X$GOTO START_WORK
X$
X$process_a_record:
X$ !+
X$ ! Local GoSub subroutine to process a single record
X$ !-
X$ mumble "Entered GoSub Subroutine PROCESS_A_RECORD"
X$ mumble "Line ''line_count': Contents: " + data_rec
X$ !+
X$ ! Now edit the data record for parsing later
X$ !-
X$ data_rec = F$Edit( data_rec, "COLLAPSE,UPCASE,UNCOMMENT" )
X$ If( data_rec .NES. "" )
X$ Then
X$`09req_nod = F$Element( fld_nod, fs, data_rec )
X$`09mumble "Line ''line_count': Requested node: " + req_nod
X$`09If( (req_nod .EQS. any_node ) .OR. -
X`09`09(F$Locate( this_node,req_nod) .LT. F$Lenght( req_nod )))
X$`09Then
X$`09 mumble "Line ''line_count': Local node contained in requested nodes"
X$`09 GoSub Dispatch_A_Procedure
X$`09Else
X$`09 mumble "Line ''line_count': Local node not contained in " +-
X`09`09`09 "requested nodes"
X$`09EndIf
X$ Else
X$`09mumble "Line ''line_count': No actions requested"
X$ EndIf
X$ mumble "Exiting GoSub Subroutine PROCESS_A_RECORD"
X$ return
X$
X$dispatch_direct:
X$ mumble "Entered GoSub Subroutine DISPATCH_DIRECT"
X$ SayMsg "Starting direct execution of ''file_to_execute' at ''F$Time()'"
X$ If test_mode
X$ Then
X$`09SayMsg "Line ''line_count': Test Mode, File ''file_to_execute' " +-
X`09`09"not actually executed"
X$ Else
X$`09set NOon
X$`09@'file_to_execute' -
X`09 "''par_1'" -
X`09 "''par_2'" -
X`09 "''par_3'" -
X`09 "''par_4'" -
X`09 "''par_5'" -
X`09 "''par_6'" -
X`09 "''par_7'" -
X`09 "''par_8'"
X$`09on error then`09$ goto error_exit
X$ EndIf
X$ SayMsg "Finished direct execution of ''file_to_execute' at ''F$Time()'"
X$dispatch_direct_return:
X$ mumble "Exiting GoSub Subroutine DISPATCH_DIRECT"
X$ return
X$
X$dispatch_batch:
X$ mumble "Entered GoSub Subroutine DISPATCH_BATCH"
X$ If test_mode
X$ Then
X$`09SayMsg "Line ''line_count': Test Mode, File ''file_to_execute' " +-
X`09`09"not actually submitted"
X$ Else
X$`09file_to_execute_name`09= F$Parse( file_to_execute,,,"NAME" )
X$`09on error then`09$ goto dispatch_batch_error
X$`09submit -
X`09 /parameter`09= ("''par_1'", -
X`09`09`09 "''par_2'", -
X`09`09`09 "''par_3'", -
X`09`09`09 "''par_4'", -
X`09`09`09 "''par_5'", -
X`09`09`09 "''par_6'", -
X`09`09`09 "''par_7'", -
X`09`09`09 "''par_8'" ) -
X`09 /NOprint -
X`09 /name = 'file_to_execute_name' -
X`09 /queue = 'execution_queue' -
X`09 /log = 'execution_log' -
X`09`09'file_to_execute'
X$`09on error then $ goto error_exit
X$`09SayMsg "''file_to_execute' submitted as entry ''$entry' " + -
X`09`09"on queue ''execution_queue' at ''F$Time()'"
X$ EndIf
X$dispatch_batch_return:
X$ mumble "Exiting GoSub Subroutine DISPATCH_BATCH"
X$ return
X$dispatch_batch_error:
X$ SayErr "Unable to queue ''file_to_execute'"
X$ goto dispatch_batch_return
X$dispatch_a_procedure:
X$ mumble "Entered GoSub Subroutine DISPATCH_A_PROCEDURE
X$ !+
X$ ! Decode requested action and check it for validity
X$ !-
X$ req_act = F$Element( fld_act, fs, data_rec )
X$ mumble "Line ''line_count': Requested Action: " + req_act
X$ If( (req_act .EQS. bat_act) .OR. (req_act .EQS. dir_act) )
X$ Then
X$`09mumble "Line ''line_count': Valid action (''req_act') requested
X$`09!+
X$`09! Get the command procedure specification and attempt to parse it
X$`09!-
X$`09req_pro = F$Element( fld_pro, fs, data_rec )
X$`09mumble "Line ''line_count': procedure specification: " + req_pro
X$`09file_to_execute = F$Search( req_pro )
X$`09If ( file_to_execute .EQS. "" )
X$`09Then`09 ! Check for file in default location
X$`09 file_to_execute = F$Parse( req_pro, -
X`09`09`09`09".COM;0","pbs_cmn_bin:" )
X$`09 file_to_execute = F$Search( file_to_execute )
X$`09EndIf
X$`09mumble "Line ''line_count': parsed file spec: " + file_to_execute
X$`09If( file_to_execute .NES. "" )
X$`09Then
X$`09 mumble "Line ''line_count': File specified: ''file_to_execute'"
X$`09 !+
X$`09 ! Now decode any remaining fields as parameters to the
X$`09 ! procedure. Remember that elements are counted from zero (0)
X$`09 ! and parameters from 1. In addition we need to start the
X$`09 ! decode operation with element 3 (the fourth element in the
X$`09 ! element list), so there are a number of adjustments to get
X$`09 ! P1 decoded from element 3, P2 from element 4, etc.
X$`09 !-
X$`09 par_1 = F$Element( fld_p1, fs, data_rec ) - fs
X$`09 par_2 = F$Element( fld_p2, fs, data_rec ) - fs
X$`09 par_3 = F$Element( fld_p3, fs, data_rec ) - fs
X$`09 par_4 = F$Element( fld_p4, fs, data_rec ) - fs
X$`09 par_5 = F$Element( fld_p5, fs, data_rec ) - fs
X$`09 par_6 = F$Element( fld_p6, fs, data_rec ) - fs
X$`09 par_7 = F$Element( fld_p7, fs, data_rec ) - fs
X$`09 par_8 = F$Element( fld_p8, fs, data_rec ) - fs
X$`09 If( mumble_debug ) then $ show sym par_%
X$`09 GoSub dispatch_'req_act'`09! Actually perform the action
X$`09Else
X$`09 SayErr "Line ''line_count': Unable to locate file " + req_pro
X$`09EndIf
X$ Else
X$`09SayErr "Line ''line_count': Unknown action requested: " + req_act
X$ EndIf
X$ mumble "Exiting GoSub Subroutine DISPATCH_A_PROCEDURE
X$ return
X$!--------------------------------------------------------------------------
V----
X$! Start procedure setup
X$!--------------------------------------------------------------------------
V----
X$ goto bad_subroutine
X$START_WORK:
X$ on error then $ goto error_exit
X$ on control_y then`09$ goto control_y_exit
X$ save_verify = F$Verify(0)
X$ pcdnam = F$Parse( F$Environment( "PROCEDURE" ),,,"NAME")
X$ pcdid = pcdnam + " `5B''F$Getjpi( 0, "PID" )'`5D"
X$ mumble_debug := "FALSE"
X$ saymsg := "Write sys$output ""''pcdid': "" +"
X$ mumble := "If mumble_debug then $ Write sys$output ""''pcdid':
V . "" +"
X$ sayerr := "Write sys$output ""''pcdid': * "" +"
X$ mumble "Procedure Entry: ''F$Time()'"
X$!--------------------------------------------------------------------------
V----
X$! Local symbols defined here
X$!--------------------------------------------------------------------------
V----
X$ !+
X$ ! You may have to change the "THIS_NODE" symbol definition if the SYSGEN
X$ ! parameter SCSNODE has not been defined, you can hard code this value o
Vr
X$ ! pull it out of the SYS$NODE logical name if it has been defined.
X$ !-
X$ this_node`09= F$Getsyi("NODENAME" )
X$ execution_queue`09= "''this_node'_SYSBATCH"
X$ execution_log`09= "sys$specific:`5Bsysmgr`5D"
X$
X$ !+
X$ ! Now check if the PBS Common action logicals for TEST and MUMBLE have
X$ ! been set or not. If they have been set to TRUE then set the appropria
Vte
X$ ! symbols.
X$ !-
X$ If( F$Trnlnm( "PBS_CMN_ACTION_TEST" ) .EQS. "TEST" )
X$ Then
X$`09test_mode = "TRUE"
X$ Else
X$`09test_mode = "FALSE"
X$ EndIf
X$ !
X$ If( F$Trnlnm( "PBS_CMN_ACTION_MUMBLE" ) .EQS. "TRUE" )
X$ Then
X$`09mumble_debug = "TRUE"
X$ Else
X$`09mumble_debug = "FALSE"
X$ EndIf
X$
X$ !+
X$ ! Build a symbol for our data file. This must be unique to this
X$ ! process and procedure depth to avoid problems with multiple invocation
Vs
X$ ! of the command procedure.
X$ !-
X$ data_file = "data_''F$Pid(0)'_''F$Environment( "DEPTH" )'"
X$
X$ fs`09`09= "`7C"`09! Field separator character
X$ fld_nod`09= 0`09! Node specification field
X$ fld_act`09= 1`09! Action request field
X$ fld_pro`09= 2`09! Procedure specification field
X$ fld_p1`09= 3`09! Field for P1
X$ fld_p2`09= 4`09! Field for P2
X$ fld_p3`09= 5`09! Field for P3
X$ fld_p4`09= 6`09! Field for P4
X$ fld_p5`09= 7`09! Field for P5
X$ fld_p6`09= 8`09! Field for P6
X$ fld_p7`09= 9`09! Field for P7
X$ fld_p8`09= 10`09! Field for P8
X$
X$ any_node`09= "*"`09! Execute on any node (shorthand)
X$
X$ bat_act`09= "BATCH" ! Batch Execution Requested
X$ dir_act`09= "DIRECT" ! Direct Execute Requested
X$
X$!--------------------------------------------------------------------------
V----
X$! Start Main Procedure Processing
X$!--------------------------------------------------------------------------
V----
X$ !+
X$ ! Check if parameters have been specified properly, if so then
X$ ! execute rest of primary loop
X$ !-
X$ If( P1 .EQS. "" )
X$ Then
X$`09SayErr "Parameter 1, file to process, not specified"
X$ Else
X$`09mumble "P1, File to precess: ''P1'"
X$`09file_to_open = F$Parse( p1, "pbs_cmn_data:.DAT;0" )
X$`09If( file_to_open .EQS. "" )
X$`09Then
X$`09 file_to_open = F$Search( p1 )
X$`09EndIf
X$`09mumble "Parsed file specification: ''file_to_open'"
X$`09file_to_open = F$Search( file_to_open )
X$`09If ( file_to_open .EQS. "" ) then $ goto no_file_to_open
X$`09SayMsg "Input from file: ''file_to_open' ''F$Time()'"
X$`09open -
X`09 /error = open_file_error -
X`09 /read -
X`09 /share -
X`09`09'data_file' -
X`09`09'file_to_open'
X$`09!+
X$`09! Now set up a loop to read through the data
X$`09!-
X$`09line_count = 0
X$`09read_loop:
X$`09 line_count = line_count + 1
X$`09 read -
X`09`09/end`09= eof_on_read -
X`09`09/error`09= read_error_handler -
X`09`09 'data_file' -
X`09`09 data_rec
X$`09 GoSub Process_a_Record
X$`09 goto read_loop
X$`09read_error_handler:
X$`09 saved_status = $status
X$`09 SayErr "Line ''line_count': Error during read"
X$`09 SayErr "Error Returned: ''F$Message( saved_status )'"
X$`09 goto read_loop
X$`09read_loop_done:
X$`09eof_on_read:
X$`09close 'data_file'
X$`09final_exit = 1
X$ Else
X$`09SayErr "P1, File to process: *MISSING*"
X$`09final_exit = 44
X$ EndIf
X$ `20
X$exit:
X$ saved_status = 1
X$ goto final_exit
X$no_file_to_open:
X$ !+
X$ ! Specified file does not exist, tell user and abort
X$ !-
X$ SayErr "Cannot find file ''p1'"
X$ saved_status = 44
X$ goto final_exit
X$open_file_error:
X$ !+
X$ ! Unable to open file, post error
X$ !-
X$ saved_status = $status
X$ msg`09= F$Message( saved_status )
X$ SayErr "Unable to open file: ''file_to_open'"
X$ SayErr "Error Returned by OPEN: ''msg'"
X$ goto final_exit
X$
X$bad_subroutine:
X$ SayErr "Bad entry to procedure start, possible bad subroutine return"
X$ saved_status = 44
X$ goto final_exit
X$control_y_exit:
X$ saved_status = 44
X$ SayErr "Aborting -- Control-y entered"
X$ goto final_exit
X$error_exit:
X$ saved_status = $status
X$ SayErr "Aborting -- Unknown error encountered"
X$ goto final_exit
X$final_exit:
X$ If( F$Trnlnm( data_file ) .NES. "" )
X$ Then
X$`09close 'data_file'
X$ EndIf
X$ mumble "Procedure Exit: ''F$Time()'"
X$ If F$Type( save_verify ) .EQS. "INTEGER" then $ junk = F$Verify( save_ve
Vrify)
X$ exit saved_status
X$!==========================================================================
V====
X$! DEC/CMS REPLACEMENT HISTORY, Element PBS_EXECUTE_PROCEDURE.COM
X$! *7 13-JAN-1992 15:51:02 SDROPPERS "Added better log file specification
V for batch jobs"
X$! *6 13-JAN-1992 10:39:31 SDROPPERS "Set to ignore status of direct exec
Vute procedures"
X$! *5 13-JAN-1992 09:57:11 SDROPPERS "Increased resistance to internal er
Vrors"
X$! *4 10-JAN-1992 13:45:20 SDROPPERS "Set to allow logical name search li
Vsts as well as logical names"
X$! *3 20-SEP-1991 14:35:07 SDROPPERS "Fixed F$Parse call that was not ret
Vurning proper file names, improved test and mumble
X$!specs"
X$! *2 16-APR-1991 10:03:16 SDROPPERS "Added default directories for files
V"
X$! *1 15-APR-1991 11:33:49 SDROPPERS "Command procedure to execute other
V command procedures"
X$! DEC/CMS REPLACEMENT HISTORY, Element PBS_EXECUTE_PROCEDURE.COM
$ CALL UNPACK PBS_EXECUTE_PROCEDURE.COM;2 270539710
$ create 'f'
X*`09`09`09`09`7Cdirect`09`09`7Csecurity_startup
Xbert,bigbrd,cookie,ernie,snuffy`09`7Cdirect`09`09`7Csys$startup:spm$startup.
Vcom
Xbert,bigbrd,cookie,ernie,snuffy`09`7Cdirect`09`09`7Cpbs_define_logical_names
V`09`7Cpbs_cmn_data:spm_logical_names.dat
X! DEC/CMS REPLACEMENT HISTORY, Element PBS_LPBEGIN.DAT
X! *3 7-OCT-1991 16:21:47 SDROPPERS "Added call for SECURITY_STARTUP.COM"
X! *2 20-SEP-1991 14:09:54 SDROPPERS "Fixed problem with SPM startup"
X! *1 9-SEP-1991 16:03:15 SDROPPERS "Command procedures to execute during
V the LPBEGIN phase of startup"
X! DEC/CMS REPLACEMENT HISTORY, Element PBS_LPBEGIN.DAT
$ CALL UNPACK PBS_LPBEGIN.DAT;1 706500545
$ create 'f'
X!
X! PBS LPMain startups
X!`09Command procedures to be started during the LPMain part of startup
X!
X! DEC/CMS REPLACEMENT HISTORY, Element PBS_LPMAIN.DAT
X! *6 13-APR-1992 10:06:37 SDROPPERS "Removed SPM and Sequelink startups (
Vsequelink now part of PBS_Network_Startup)"
X! *5 25-OCT-1991 14:31:42 SDROPPERS "Removed TWG and TGV startups"
X! *4 26-SEP-1991 15:08:40 SDROPPERS "Added Sequelink startup on SNUFFY"
X! *3 23-SEP-1991 12:06:09 SDROPPERS "Added call for extended Multinet sta
Vrtup (helps with INGRES)"
X! *2 20-SEP-1991 15:36:21 SDROPPERS "Added calls to start TCP/IP software
V"
X! *1 9-SEP-1991 16:03:56 SDROPPERS "Command procedures to execute during
V LPMAIN phase of startup"
X! DEC/CMS REPLACEMENT HISTORY, Element PBS_LPMAIN.DAT
$ CALL UNPACK PBS_LPMAIN.DAT;1 1159903165
$ create 'f'
X$!==========================================================================
V====
X$!NAME: PBS_MOUNT_PAGESWAP.COM
X$!
X$!PROJECT/FACILITY: PBS Common Startup
X$!
X$!AUTHOR(S):`09 Seton R. Droppers / System Manager
X$!`09`09 Public Broadcasting Service / Computer Services
X$!`09`09 1320 Braddock Place
X$!`09`09 Alexandria, VA 22314-1698
X$!`09`09 (703) 739-5100
X$!
X$!CREATION DATE: 11-APR-1991 11:32:49.70
X$!
X$! Copyright 1991. Public Broadcasting Service. All rights reserved.
X$!
X$! This software is furnished for the purpose of example only. While PBS
X$! does not object to others copying or using the software, provided the
X$! above copyright notice is placed on any copies made, PBS disclaims any
X$! responsibility and liability for the suitability, reliability or use o
Vf
X$! the software for any purpose. Any user of this software will be solely
X$! responsible for its use.
X$!
X$!
X$!FUNCTIONAL DESCRIPTION:
X$!
X$! This command procedure mounts page and swap files as specified by a data
X$! file. The data file specifies the node, style, and file to be mounted.
X$!
X$! The specified file consists of records, one record per line of the file.
X$! Each record consists of multiple fields, the fields being seperated by a
X$! vertical bar ("`7C") character. Each record consists of the following f
Vields:
X$!
X$! node `7C sytle `7C file_spec
X$!
X$! Where:
X$!`09node`09 Specifies the node to mount the file on
X$!
X$!`09style`09 Specifies if the file is a page or swap file
X$!
X$!`09file_spec The file to mount as a page or swap file
X$!
X$!PARAMETERS:
X$!
X$! P1 (REQUIRED) The name of the file to read to get the command procedur
Ve
X$!`09`09 specifications from.
X$!
+-+-+-+-+-+-+-+- END OF PART 1 +-+-+-+-+-+-+-+-
Technical Details
Message-ID:
<7662008@MVB.SAIC.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!network.ucsd.edu!mvb.saic.com!vmsnet-sourcesShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!network.ucsd.edu!mvb.saic.com!vmsnet-sources From: sdroppers@pbs.org Newsgroups: vmsnet.sources Subject: PBS Startup Examples, part 01/02 Message-ID: <7662008@MVB.SAIC.COM> Date: Thu, 06 Aug 1992 13:44:50 GMT Organization: PBS:Public Broadcasting Service, Alexandria, VA Lines: 1398 Approved: Mark.Berryman@Mvb.Saic.Com