[Info-vax] SHO DEV xxx/FILE on LD devices
Jan-Erik Soderholm
jan-erik.soderholm at telia.com
Wed Jul 6 11:02:29 EDT 2011
Jim wrote 2011-07-06 16:49:
> 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
Yes, I thought about something like that. One thing I see with
your routines is that is expect any installed files to be
known by the base device name. In my case I had entries like :
DISK$JFPLIB0004A:<LIBBZ2>.EXE
libbz2shr32-1_0_4;1
DISK$JFPLIB0004A:<LIBZ>.EXE
LIBZSHR32-1_2_3_EV56;1
DISK$JFPPY0021A:<PYTHON254.VMS.LIB>.EXE
pythonshr;2 Open Hdr Shared Lnkbl
PYTHON_LIBCRYPTO_SHR32;1
Open Hdr Shared Lnkbl
PYTHON_LIBSSL_SHR32;1
Open Hdr Shared Lnkbl
Where the two DISK$JF* ligicals points to the LD devices :
$ sh log disk$jf*
(LNM$SYSTEM_TABLE)
"DISK$JFPLIB0004A" = "$1$LDA1:"
"DISK$JFPPY0021A" = "$1$LDA2:"
Your routines just looks for the base LD names, right ?
Jan-Erik.
More information about the Info-vax
mailing list