[comp.unix.wizards] /etc/rmt on suns -- does it work? Having trouble, TFM doesn't help

levy@ttrdc.UUCP (Daniel R. Levy) (03/18/89)

Unix-Gurus of the net, HALLLLLLLLLLP!!!!

I have made the apparent mistake of believing the SUN manpage rmt(8C) for
/etc/rmt, the remote magtape daemon.  According to the documentation, as I
read it, I should be able to start /etc/rmt and feed it commands and data, and
expect acknowledgments and data back from it.  Well, that doesn't seem to work
very well (read: at ALL).  I tried it locally (that shouldn't matter, should
it?)  and here's what happens with a tape, write protect turned off (i.e.
writeable), in drive /dev/rst0, on a SUN4 under SunOS 4.0:

skfe$ ls -l /dev/rst0
crw-rw-rw-  1 root      18,   0 Aug 31 1988 /dev/rst0
skfe$ echo TEST | dd conv=sync of=/dev/rst0
0+1 records in
1+0 records out
skfe$ dd if=/dev/rst0
TEST
1+0 records in
1+0 records out
skfe$ /etc/rmt
O /dev/rst0 438 [me -- note that 438 decimal is 0666 octal]
R 512 [me -- try to read a record]
E2 [from /etc/rmt]
No such file or directory [from /etc/rmt]
S [me -- try to get tape status]
E9 [from /etc/rmt]
Bad file number [from /etc/rmt]
skfe$ echo $?
3

The manpage doesn't say what input commands are supposed to be terminated
with; I am assuming newline since the returned acknowledgment/error commands
are also thus terminated.  I tried null, and then I tried space, instead;
neither elicited any output from /etc/rmt at all.  I get the same behavior
on a Sun-3 under SunOS 3.5 as I did above.

At this point I'm up a (binary) tree.  Does /etc/rmt really WORK, and what
should I send it to make it work?  Does it require arguments?  (I found that
if I gave it an argument, it would create an empty file of the same name as
the argument -- weird?!?)

Thanks mucho in advance-o!
-- 
Daniel R. Levy             UNIX(R) mail:  att!ttbcad!levy
AT&T Bell Laboratories
5555 West Touhy Avenue     Any opinions expressed in the message above are
Skokie, Illinois  60077    mine, and not necessarily AT&T's.

guy@auspex.UUCP (Guy Harris) (03/22/89)

Oh, BTW:

>O /dev/rst0 438 [me -- note that 438 decimal is 0666 octal]

Note also that the "mode" argument to the "O" command is an *open* mode,
not a file permissions mode - the description says "open the specified
device using the indicated mode", which pertains better to open modes
such as O_RDONLY, etc. than to file-creation modes - so it should be
something like 0 (O_RDONLY), 1 (O_WRONLY), or 2 (O_RDWR), rather than
something like 0666.

(Also, note that it's "Sun", not "SUN" - it's an acronym when it refers to
the Stanford University Network project, but not when it refers to Sun
Microsystems.)

dcornutt@uahcs1.UUCP (David C. Cornutt) (03/29/89)

In article <3274@ttrdc.UUCP>, levy@ttrdc.UUCP (Daniel R. Levy) writes:
> I have made the apparent mistake of believing the SUN manpage rmt(8C) for
> /etc/rmt, the remote magtape daemon.  According to the documentation, as I
> read it, I should be able to start /etc/rmt and feed it commands and data, and
> expect acknowledgments and data back from it.  Well, that doesn't seem to work
> very well (read: at ALL).  I tried it locally (that shouldn't matter, should
> it?)  and here's what happens with a tape, write protect turned off (i.e.
> writeable), in drive /dev/rst0, on a SUN4 under SunOS 4.0:
> 
> O /dev/rst0 438 [me -- note that 438 decimal is 0666 octal]
    ^^^^^^^^^ ^^^
> Daniel R. Levy             UNIX(R) mail:  att!ttbcad!levy

I went through this same exercise about a year ago.  If I remember right
(which I frequently don't), you have to put each of the arguments to
every command on a line by itself; i.e., separate the command args
with newlines instead of spaces.

Sorry about not having a signature or return path.  I just got back on
the net after a long absence, and I haven't learned the local topology yet.

David Cornutt
uahcs1