[Info-vax] SHO DEV xxx/FILE on LD devices

Jim mckinneyj at saic.com
Wed Jul 6 10:49:27 EDT 2011


On Jul 6, 6:04 am, Jan-Erik Soderholm <jan-erik.soderh... at telia.com>
wrote:
> hb wrote 2011-07-06 11:37:
>
>
>
>
>
> > On Jul 6, 1:28 am, Johnny Billquist<b... at softjar.se>  wrote:
> >> On 2011-07-05 23.46, Hans Vlems wrote:
>
> >>> On 5 jul, 23:37, Jan-Erik Soderholm<jan-erik.soderh... at telia.com>
> >>> wrote:
> >>>> Bob Koehler wrote 2011-07-05 19:30:
>
> >>>>> In article<iuutf2$cq... at news.albasani.net>, Jan-Erik Soderholm<jan-erik.soderh... at telia.com>      writes:
> >>>>>> Hi.
> >>>>>> Can someone tell why the below happens.
>
> >>>>>> $ dism/abo $1$lda1:
> >>>>>> %DISM-W-CANNOTDMT, $1$LDA1: cannot be dismounted
> >>>>>> %DISM-W-INSTIMAGE, 2 images installed on volume
>
> >>>>>> $ sh dev $1$lda1:/file
>
> >>>>>> Files accessed on device $1$LDA1: (OSSBY1) on  5-JUL-2011 13:29:49.84
>
> >>>>>> Process name      PID     File name
> >>>>>>                     00000000  [000000]INDEXF.SYS;1
> >>>>>> $
>
> >>>>>       Are you using a prvilegdge account, or at least one that has access
> >>>>>       to the directory path and files?
>
> >>>>>       I'm not sure about this one, but some VMS utilities will not show
> >>>>>       the names of files that a particular user doesn't have access to.
>
> >>>> It was SYSTEM. But I think it was simply the fact that the files
> >>>> had never been opened since installed. And thus didn't show up
> >>>> as an opened file. But on the other hand, I *thought* that *all*
> >>>> installed files showed up as files with no process-name in the
> >>>> SHO DEV/FILE list...
>
> >>>> Anyway, this is not an issue.
>
> >>> Contact Jur van den Burg atwww.digiater.nl:he'sthe author and
> >>> maintains LD.
>
> >> This has nothing to do with the LD device. It's a standard behavior of VMS.
> >> "Opened file" means open right now. Not "have been opened sometimes in
> >> tne past", nor "installed". It means it's currently open by a process.
> >> An installed file is an installed file, which is something else.
> >> You must remove files from being installed before you are allowed to
> >> dismount a device. If a file is open on the device, VMS can either
> >> complain, or else mark the device for dismount, which will be completed
> >> when all files have been closed. I don't remember which way VMS actually
> >> do it.
> >> But what was shown by the original post is completely natural, and to be
> >> expected if usage matches.
>
> >>          Johnny
>
> > Just to summarize what previous posters already said ...
>
> >  From the help of SHOW DEVICE /FILES:
> > Displays a list of the names of all files open on a volume and their
> > associated process name and process identification (PID).
>
> > INSTALL ADD file-spec makes a file known (creates a KFE - a Known File
> > Entry). Although not widely known, this can be done with any file.
> > However, a known file is not open. So files installed that way do not
> > show with SHOW DEVICE /FILES. Obviously you can not dismount the
> > device while there are known files for that device. INSTALL LIST has
> > no way to show the installed files per device. You may want to
> > redirect INSTALL's output and search for the device, like in:
> > $ PIPE INSTALL LIST |SEARCH SYS$INPUT DISK$TMP/WINDOW=(0,999)/PAGE
>
> > INSTALL ADD/OPEN file-spec makes an image file known and permanently
> > open. Image files installed that way are shown with SHOW DEVICE/FILES.
>
> >  From the help of SHOW DEVICE /FILES:
> > If the /SYSTEM qualifier is also specified, only the names of
> > installed files and files opened by the system are displayed.
>
> > This may be confusing. /SYSTEM limits the output of open files to
> > image files installed with /OPEN and the files opened by the system.
>
> Yes, I understand all that now.
>
> What I want now is a something like :
>
> $ DISMOUNT/AND_DEINSTALL_ALL_INSTALLED_FILES dev:
>
> :-)
>
> Right now, I have to either maintain a list of installed
> files in SYSHUTDWN.COM, or have separate <app>_SHUTDOWN.COM
> files for each application.
>
> It "works", but a way to unconditionaly deinstall all files
> and force a dismount would also be nice.


Maybe this will help... extracted from my SYSHUTDWN.COM.


$! ** Start LDdriver Shutdown
$! ** +
$! make sure these are all dismounted before dismounting backing
hardware
$ ucb$v_template = 8192         ! skip lda0 template device
$ldloop:
$ disk = f$device("*lda*","disk")
$ if disk .eqs. "" then goto lddone
$ if (f$integer(f$getdvi(disk,"sts")) .and. ucb$v_template) .eq. -
     ucb$v_template then goto ldloop
$ if f$getdvi(disk,"mnt")
$ then
$   if f$getdvi(disk,"transcnt") .gt. 1 then call deinstall "''disk'"
$   write sys$output "Dismounting ''disk' . . ."
$   dismount/nounload 'disk'
$ endif
$ ld disconnect 'disk'
$ goto ldloop
$lddone:
$ show device ld
$! ** -
$! ** End of LDdriver shutdown
$!
$!
$! ** Start disk dismounting
$! ** +
$! dismount any disks that are possible
$diskloop:
$ disk = f$device(,"disk")
$ if disk .eqs. "" then goto disksdone
$ if disk .eqs. f$getdvi("sys$sysdevice","fulldevnam") then goto
diskloop
$ if f$getdvi(disk,"shdw_member") then goto diskloop
$ if .not f$getdvi(disk,"mnt") then goto diskloop
$ if f$getdvi(disk,"transcnt") .gt. 1 then call deinstall "''disk'"
$ if f$getdvi(disk,"transcnt") .eq. 1
$ then
$   write sys$output "Dismounting ''disk'"
$   dismount/nounload 'disk'
$ else
$    write sys$output -
     f$fao("!_"),"*** Unable to dismount disk ",disk," - disk still
active"
$ endif
$ goto diskloop
$disksdone:
$ show device d
$! ** -
$! ** End disk dismounting
$!
$ exit 1
$!
$!
$!
$deinstall: subroutine  ! attempt to locate and remove any INSTALLed
images
$ ! %X00000110 => %SYSTEM-W-INSFARG, insufficient call arguments
$ if p1 .eqs. "" then exit ! %X00000110
$ ! %X00000908 => %SYSTEM-W-NOSUCHDEV, no such device available
$ if .not. f$getdvi(p1,"exists")
$ then
$   write sys$output "Unable to deINSTALL images, ''p1' does not
exist"
$   exit %X00000908
$ endif
$ target = f$getdvi(p1,"devnam")
$ write sys$output ""
$ write sys$output "Scanning for INSTALLed images on ''target' . . ."
$ write sys$output ""
$ tmpfil := sys$scratch:'f$unique()'.tmp
$ define/user sys$output 'tmpfil'
$ install list
$ count = 0
$ match = 0
$ open/read input 'tmpfil'
$next_image:
$ read/error=nomore_images input record
$ if f$locate(":",record) .ne. f$length(record)
$ then
$   match = 0
$   device = f$getdvi(f$element(0,":",record),"devnam")
$   if device .eqs. target
$   then
$     match = 1
$     location = f$element(0,">",record) + ">"
$     ext = f$element(1,">",record)
$   endif
$   goto next_image
$ endif
$ if .not. match then goto next_image
$ if f$locate(";",record) .eq. f$length(record) then goto next_image
$ filename = f$element(0,";",f$edit(record,"trim"))
$ filespec = location + filename + ext
$ write sys$output "  deINSTALLing ''filespec' . . ."
$ install remove 'filespec'
$ count = count + 1
$ goto next_image
$nomore_images:
$ close input
$ delete 'tmpfil';0
$ write sys$output ""
$ if count .ne. 0
$ then
$   write sys$output "''count' images deINSTALLed on ''target' . . ."
$ else
$   write sys$output "No INSTALLed images located on ''target' . . ."
$ endif
$ write sys$output ""
$ exit 1
$ endsubroutine



More information about the Info-vax mailing list