$ ! $ ! File name: TCPIP$PROXY_RELOAD.COM $ ! Product: HP TCP/IP Services for OpenVMS $ ! Version: V5.7-13 $ ! $ ! © Copyright 1976, 2009 Hewlett-Packard Development Company, L.P. $ ! $ ! Confidential computer software. Valid license from HP and/or its $ ! subsidiaries required for possession, use, or copying. $ ! $ ! Consistent with FAR 12.211 and 12.212, Commercial Computer Software, $ ! Computer Software Documentation, and Technical Data for Commercial $ ! Items are licensed to the U.S. Government under vendor's standard $ ! commercial license. $ ! $ ! Neither HP nor any of its subsidiaries shall be liable for technical $ ! or editorial errors or omissions contained herein. The information $ ! in this document is provided "as is" without warranty of any kind $ ! and is subject to change without notice. The warranties for HP $ ! products are set forth in the express limited warranty statements $ ! accompanying such products. Nothing herein should be construed as $ ! constituting an additional warranty. $ ! $ set := $ set noon $ set symbol /scope=(nolocal,global) $ set symbol /scope=(nolocal,noglobal)/verb $ on control_y then goto abort_exit $ serv_proc = f$environment("procedure") $ serv_id = f$parse(serv_proc,,,"name") - "_RELOAD" $ serv_nam = f$parse(serv_proc,,,"name") - "TCPIP$" - "_RELOAD" $ serv_privs = f$edit("cmkrnl,oper,sysnam,sysprv","upcase") $ ! $ ! get proxy reload procedure parameters $ ! $ get_parameters: $ tcpip$reload_loginfo == f$edit(p1,"trim,upcase") $ ! $ ! set privileges needed to reload proxy $ ! $ set_privileges: $ prev_privs = f$setprv(serv_privs) $ if .not. f$privilege(serv_privs) $ then $ tcpip$serv_fail == "TCPIP-E-NOPRIV, requires ''serv_privs' privileges" $ goto error_exit $ endif $ ! $ ! check if proxy and nfs have been started; shut down nfs server if so $ ! $ check_startup: $ if f$trnlnm("''serv_id'_STARTED","TCPIP$STARTUP_TABLE",,"executive","case_sensitive") .eqs. "" $ then $ write sys$output "%TCPIP-W-NOSERVSTART, ''serv_id' not started" $ endif $ $ if f$trnlnm("TCPIP$NFS_STARTED","TCPIP$STARTUP_TABLE",,"executive","case_sensitive") .eqs. "" $ then $ write sys$output "%TCPIP-W-NOSERVSTART, TCPIP$NFS not started" $ else $ nfs_comproc = f$edit("sys$startup:tcpip$nfs_shutdown.com","upcase") $ @'nfs_comproc' quiet $ wait 00:00:02 $ endif $ ! $ ! unload and reload the proxy execlet, then repopulate $ ! the proxy database and restart the nfs server $ ! $ reload_proxy: $ call unload_subsystem "proxy" $ $ if f$trnlnm("tcpip$proxy_services","lnm$system",,"executive") .eqs. "" $ then $ call set_syslognam - tcpip$proxy_services - sys$loadable_images:tcpip$proxy_services.exe $ endif $ $ call set_startup "''serv_id'" "Started" $ $ call load_subsystem "proxy" $ if .not. $status $ then $ goto error_exit $ endif $ $ tcpip load proxy $ if $status $ then $ call log_info "%TCPIP-I-INFO, nfs proxies reloaded" $ endif $ $ nfs_comproc = f$edit("sys$startup:tcpip$nfs_startup.com","upcase") $ @'nfs_comproc' 'tcpip$reload_loginfo' $ ! $ ! proxy reload completed successfully $ ! $ normal_exit: $ call set_startup "''serv_id'" "Completed" $ serv_status = 1 $ write sys$output "%TCPIP-S-RELODONE, NFS proxy database reload completed" $ ! $ ! restore previous privileges and exit $ ! $ exit: $ if f$type(tcpip$reload_loginfo) .nes. "" $ then $ delete /symbol/global tcpip$reload_loginfo $ endif $ $ if f$type(tcpip$serv_fail) .nes. "" $ then $ delete /symbol/global tcpip$serv_fail $ endif $ $ if f$type(prev_privs) .nes. "" $ then $ prev_privs = f$setprv(prev_privs) $ endif $ $ exit serv_status .or. %x10000000 $ ! $ ! proxy reload aborted by user $ ! $ abort_exit: $ serv_status = 0 $ write sys$output "%TCPIP-W-RELOABORT, NFS proxy database reload aborted by user" $ goto exit $ ! $ ! proxy reload error $ ! $ error_exit: $ serv_status = 2 $ write sys$output "%TCPIP-E-RELOFAIL, failed to reload NFS proxy database" $ write sys$output "-''tcpip$serv_fail'" $ goto exit $ ! $ ! load/configure subsystem (p1 = subsystem name) $ ! $ load_subsystem: subroutine $ set noon $ $ sysconfig := $'f$edit("sys$system:tcpip$sysconfig.exe","upcase")' $ $ sysconfig -c 'p1' $ status = $status $ $ if status $ then $ call log_info "%TCPIP-I-INFO, subsystem ''p1' loaded" $ else $ tcpip$serv_fail == "TCPIP-E-SUBLOADERR, error loading subsystem ''p1'" $ endif $ $ exit status .or. %x10000000 $ endsubroutine $ ! $ ! log informational message (p1 = message text) $ ! $ log_info: subroutine $ set noon $ $ if (tcpip$reload_loginfo .eqs. "") .or. (tcpip$reload_loginfo .nes. "QUIET") $ then $ write sys$output "''p1'" $ endif $ $ exit 1 $ endsubroutine $ ! $ ! set service entry in startup table (p1 = service id, p2 = startup status) $ ! $ set_startup: subroutine $ set noon $ serv_info = f$edit("''f$time()' User: ''f$getjpi("","username")'","trim") $ $ define /table=tcpip$startup_table/executive_mode/nolog - "''p1'_STARTED" "''p2': ''serv_info'" $ $ exit $status .or. %x10000000 $ endsubroutine $ ! $ ! set system logical name (p1 = logical name, p2 = equivalence string) $ ! $ set_syslognam: subroutine $ set noon $ $ define /system/executive_mode/nolog "''p1'" "''f$edit(p2,"upcase")'" $ $ exit $status .or. %x10000000 $ endsubroutine $ ! $ ! unload subsystem (p1 = subsystem name) $ ! $ unload_subsystem: subroutine $ set noon $ $ sysconfig := $'f$edit("sys$system:tcpip$sysconfig.exe","upcase")' $ $ sysconfig -u 'p1' $ status = $status $ $ if status $ then $ call log_info "%TCPIP-I-INFO, ''p1' subsystem unloaded" $ endif $ $ exit status .or. %x10000000 $ endsubroutine