From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 16-MAR-1993 23:44:15.10
To:	INFO-VAX <INFO-VAX@crvax.sri.com>
CC:	
Subj:	Re: mounting online docs on infoserver

On 16 Mar 1993, ZEUS::WILLIAMST wrote:

> I recently got an infoserver in, and I'd like to mount the online docs 
> on this automatically.  

I'll include my solution below.

> I can't seem to find it in my documentation.  

Neither could I.

> I created a service called ONLINE_DOCS on the infoserver, and executed
> "@sys$startup:ess$startup disk tape".  Do I need to do this on all nodes 
> in the cluster, then mount the disk(s)?  Where is this documented?  

Yes, all system from which you want to access the infoserver volumes need
bind and mount commands.  It's documented in the infoserver docs
somewhere, but I'm doing this from memory, so I can't tell you where.

By the way, I don't know if it's documented, but we had trouble when we
tried to mount/cluster the infoserver volumes.  You have to issue separate
mount commands, without the /cluster qualifier, after the bind commands,
on each system that wants access.

Caveat:  I've only done this with CDROM volumes.  I suppose there could be
variations for other types.


> hanks.
> 
> Tom Williams
> williamst@atcf.ncsc.navy.mil
> 
> 

The following is the command procedure we run at our site at system
startup time, and any time we've switched volumes in the infoserver.  I
haven't checked it for site-specific hard-coded stuff, but it should get
you started.  I have edited it (without testing the results) to shorten a
few long lines.  If I screwed up, you may have to fix it. 

Use at your own risk, of course.

--Phil

// Phil Rand                                   prand@paul.spu.edu
// Computer & Information Systems                  (206) 281-2428
// Seattle Pacific University, 3307 3rd Ave W, Seattle, WA  98119

$!===================================================================
$! ESS$MOUNT.COM - Mount infoserver drives.
$!
$!  This procedure dismounts and unbinds as many of the current infoserver
$!  disks as it can, noting those which have open files and thus cannot be
$!  dismounted.  Then it rebinds and mounts all available services except
$!  for the ones which are still mounted because they had open files.
$!
$!===================================================================
$
$   gosub preliminaries
$   gosub clean_up_logicals
$   gosub dismount_unbind
$   gosub bind_mount
$   gosub wrapup
$   exit
$
$
$!===============
$ preliminaries:
$!===============
$   say := write sys$output
$   ladcp := $ess$ladcp
$   privs_needed := cmexec, sysnam
$   old_privs = f$setprv(privs_needed)
$   if .not. f$privilege(privs_needed)
$   then
$	say "ESS$MOUNT-F-NOPRIV, Unable to obtain " -
		+ "privileges ''privs_needed'."
$	exit
$   endif
$   pid = f$getjpi(0,"pid")
$   tmpfile := sys$scratch:ess$mount.temp-'pid'
$   return
$
$!====================
$ clean_up_logicals:
$!====================
$   show logical/system/output='tmpfile' DAD$*
$   open/read tmp 'tmpfile'
$   logical_loop:
$	read tmp tmpline /end_of_file=end_logical_loop 
$	tmpline = f$edit(tmpline,"compress,upcase,trim")
$	if f$locate("=",tmpline) .ne. f$length(tmpline)
$	then
$	    left_hand_side = f$element(0,"=",tmpline) - """" - """"
$	    logical_name = f$edit(left_hand_side,"trim")
$	    if f$getdvi(logical_name,"exists") .eqs. "FALSE"
$	    then
$		say "%ESS$MOUNT-I-DEALOG, Deassigning " -
			+ "logical ''logical_name'"
$		deassign/executive_mode/system 'logical_name'
$	    endif
$	endif
$	goto logical_loop
$
$   end_logical_loop:
$	close tmp
$	return
$
$!====================
$ dismount_unbind:
$!====================
$   say "ESS$MOUNT-I-DISMUNBIND, Dismounting, unbinding "-
		+ "infoserver drives."
$   volume_list = "/"
$   show dev dad/output='tmpfile'
$   open/read tmp 'tmpfile'
$   dad_loop:
$	read tmp tmpline /end_of_file=end_dad_loop 
$	tmpline = f$edit(tmpline,"compress,upcase")
$	dev = f$element(0," ",tmpline)
$	if f$locate(":",dev) .ne. f$length(dev)
$	then
$	    unit = f$integer(dev - "DAD" - ":")
$	    if unit .ne. 0
$	    then
$		mounted = f$getdvi(dev,"mnt")
$		if mounted
$		then
$		    transcnt = f$getdvi(dev,"transcnt")
$		    if transcnt .gt. 1
$		    then
$			say "ESS$MOUNT-I-FILESOPEN, ''dev' has " -
				+ "open files."
$			volnam = f$getdvi(dev,"volnam")
$			volume_list = volume_list + volnam + "/"
$		    else
$			dismount 'dev'
$		    endif
$		else
$		    ladcp unbind 'dev'
$		endif
$	    endif
$	endif
$	goto dad_loop
$
$   end_dad_loop:
$	close tmp
$	return
$
$!==================
$ bind_mount:
$!==================
$   say "ESS$MOUNT-I-BINDMOUNT, Binding and mounting all "-
	+ "available services." 
$   define/user sys$output 'tmpfile'
$   ladcp show services
$   open/read tmp 'tmpfile'
$   service_loop:
$	read tmp tmpline /end_of_file=end_service_loop 
$	tmpline = f$edit(tmpline,"compress,upcase")
$	service = f$element(0," ",tmpline)
$	device_type = f$element(1," ",tmpline)
$	if device_type .eqs. "RRD42"
$	then
$	    if f$locate("/" + service + "/", volume_list) .eq. -
			f$length(volume_list) 
$	    then
$		ladcp bind 'service' /system
$		mount/system/nowrite dad$'service' 'service'
$	    endif
$	endif
$	goto service_loop
$   end_service_loop:
$   close tmp
$   return
$
$!=================
$ wrapup:
$!=================
$   delete 'tmpfile';*
$   t = f$setprv(old_privs)
$   return
$!=============================================================



