Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!hpfcdc!hpfcmgw!hpfcse!hpuecoa!speclab!rclark
From: rclark@speclab.bgp-usgs.gov (Roger N. Clark)
Newsgroups: comp.sys.hp
Subject: Re: allocate/deallocate command wanted
Message-ID: <210028@speclab.bgp-usgs.gov>
Date: 10 Aug 89 15:07:39 GMT
References: <210024@speclab.bgp-usgs.gov>
Organization: U.S. Geological Survey, Branch of Geophysics, Denver
Lines: 40

>i think the solution is easier than
>that which rob proposed.  at a previous
>place of employment, a command called
>"tape" took a single argument which was
>the name of the user to which the tape
>drive(s) should be assigned (owned).
>the modes of the drive are 600, so
>that prevents general users from writing
>to the tape drive.  when the user is done
>with the drive, it is assigned to root.
>
>-- hesh
>----------

I agree, and this is exactly what I was thinking of doing:  write a
little c program called "allocate" that would change the mode
and owner of the device (all versions, like /dev/rmt/0m, /dev/mt/0m, ...)
and creat a lock file somewhere to indicate the device is currently
allocated to a user.

Then make a deallocate command that would chmod and owner back
to root, and delets the lock file.  Sticky issues, are if the user
logs out and leaves the lock--run deallocate from .logout (csh)...
You would also need to check if a batch or at process was going to
run and use the tape!  Not so easy!  We could start out simply and
ignore the batch/at case.

The creation of a lock file would allow root to also use it, but
wouldn't prevent two root users from writing to the same device.

I posted the question thinking that someone would have solved the
problem by now and public domain source would exist.  If anyone out
there has such a thing, please let me know.  I haven't been able to
find anything in the usenet archives.  If it doesn't exist, I
will work on it over the next few months and post it when complete.

What would be involved to bring this sort of thing up to the
standards organizations?  How about HP?

Roger Clark