[comp.os.vms] SYS$ANNOUNCE -- a command procedure

rlb@rtpark.rtp.ge.COM (Bob Boyd 8*565-3627 04-Aug-1987 0105) (08/04/87)

During SYSTARTUP.COM we do the following:
$! COM translate to SYS$COMMON:[SYSMGR.STARTUP]
$! SPEC             SYS$SPECIFIC:[SYSMGR.STARTUP]
$!.....
$ define/system/exec sys$announce " System Startup in Progress, please wait to login "
$!.....
$ set logins/inter=1
$ set logins/inter=0
$ define/sys/exec/name=no_alias shutdown$minimum_minutes 0
$!....
$ startup$interactive_logins == 0
$ open/read/err=NOLOGDATA quota sys$system:loginqota.dat
$ read/end=EXIT quota log_limit
$ if f$TRNLNM("quota").nes."" then $ close quota
$ startup$interactive_logins == log_limit
$NOLOGDATA:
$ open/read/err=EXIT oper opa0: 
$ read/time_out=35/prompt="SYSTARTUP - Override login limit of ''log_limit':  " oper over
$ if f$TYPE(over).eqs."" then $ over = ""
$ if over.nes."" then $ startup$interactive_logins == over
$!
$ if startup$interactive_logins.le.0 then $ goto NOLOGINS
$!
$! ENABLE all of the usual goodies users want and love
$!
$ if f$SEARCH("com:enable.com").nes."" then $ @com:enable
$ define/sys/exec/name=no_alias shutdown$minimum_minutes 15
$ goto EXIT
$!
$NOLOGINS:
$ define/sys/exec sys$announce -
	" System configured for restricted access -- try again later"
$EXIT:
$ if f$TRNLNM("quota").nes."" then $ close quota
$ tv = f$VER(vfl)
$ del/sym/glo logout
$ exit
----------------------------------------------------------------------
COM:ENABLE.COM does the following:

$ vfl = f$ver(0)
$! startup:enable.com
$! command procedure to enable normal user environment when logins are
$! going to be turned on.  This procedure is not executed when logins
$! are going to be left disabled.
$!
$ set noon
$ system_extend_size = 2*f$getdvi("sys$sysdevice:","sectors")
$ set rms_default/system-
	/index/relative/disk/mag/buff=-4- ! pageable 4 buffers/file
	/extend='system_extend_size'	! 2 tracks per extend minimum
$ if f$search("com:pagefiles.com").nes."" then $ @com:pagefiles
$!
$! Initialize any common packages that are needed at this point
$!
$ if f$search("com:packages.com").nes."" then $ @com:packages 1
$!
$! Start print and batch queues
$!
$ if f$search("com:startque.com").nes."" then $ @com:startque
$!
$! Initialize remaining common packages 
$!
$ if f$search("com:packages.com").nes."" then $ @com:packages 2
$!
$! Initialize node specific packages
$!
$ if f$search("spec:packages.com").nes."" then $ @spec:packages
$!
$ if f$search("spec:termset.com").nes."" then $ @spec:termset 2
$! update the SYS$ANNOUNCE 
$ if f$search("com:announce.com").nes."" then $ @com:announce
$!
$exit:
$ exit !'f$ver(vfl)'
$!Last Modified:  25-MAY-1987 15:17:01.52, By: RLB , By:  , By:  
$!....
$!....

$! announce.com -- system startup announce builder
$ vfl = f$ver(0)
$ define/proc sys$manager sys$specific:[sysmgr]
$ version = f$edit(f$GETSYI("VERSION"),"trim")
$ node = f$getsyi("Nodename")
$ if node.eqs."" then $ node = F$trnlnm("sys$node","lnm$system")-"_"-"::"
$ boot_time = f$getsyi("BOOTTIME")
$ line1 = "  Welcome to VAX/VMS "+version+" on node "+node
$ boot_time = " on "+f$extract(0,11,boot_time)+" at "+	-
	f$extract(12,99,boot_time)
$ line1 = line1 ! +" booted "+boot_time
$ open/write new sys$manager:welcome.txt
$ write new " "
$ close new
$ if f$search("sys$manager:welcome.txt;-7").nes."" then $ -
	purge/keep=3 sys$manager:welcome.txt
$ alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
$ cpu = f$getsyi("cpu")
$ cpu_string = f$GETSYI("node_hwtype")
$ cpu_name = cpu_string
$ if f$loc(f$ext(0,1,cpu_string),alpha).ge.f$len(alpha) then $ goto NUMBER
$ cpuv780 = "11/780"
$ cpuv750 = "11/750"
$ cpuv730 = "11/730"
$ cpuuvi = "uVI"
$ cpuuvii = "uVII"
$ cpu_name = cpu'cpu_string'
$NUMBER:
$ line1 = "VAX/VMS "+version+" on node "+node+"("+cpu_name+") booted"+boot_time
$ line1 = f$fao("!#AS!AS",(80-f$len(line1))/2," ",line1)
$ line2 = ""
$ if .not.f$getsyi("cluster_member") then $ goto write_ann
$ cluster_ftime = f$getsyi("cluster_ftime")
$ cluster_ftime = " on "+f$extract(0,11,cluster_ftime)+ -
		  " at "+f$extract(12,99,cluster_ftime)
$ line2 = "Member of GE, RTP VAXCluster formed"+cluster_ftime
$write_ann:
$ open/write new sys$manager:announce.txt
$ write new " "
$ write new line1
$ if line2.nes."" then $ line2 = f$fao("!#AS!AS",(80-f$len(line2))/2," ",line2)
$ if line2.nes."" then $ write new line2
$ write new " "
$ close new
$ if f$search("sys$manager:announce.txt;-7").nes."" then $ -
	purge/keep=3 sys$manager:announce.txt
$ define/sys/exec sys$announce "@sys$manager:announce.txt"
$ define/sys/exec sys$welcome " " ! "@sys$manager:welcome.txt"
$ reply/user/bell "''node' has booted and is available "
$ deassign/proc sys$manager
$ exit ! 'f$ver(vfl)'
$!Last Modified:   9-JUL-1987 14:35:20.82, By: RLB