cu/ecu through TCP/IP (plus ecu porting status)

Leslie Mikesell les at chinet.chi.il.us
Sat May 18 03:11:41 AEST 1991


In article <1061 at aega84.UUCP> lh at aega84.UUCP (L. Hirschbiegel) writes:

>Our RFS server is of course the same type of machine (all Compaqs)
>running the identical os version.
>But anyway: the structs used by the ioctl's should never be dependend
>on the type of cpu - as long as it is all SysV.3 or SysV.4 (and this
>IS in fact the limiting factor for RFS:-). I didn't find any differences
>in struct termio (which is obviously used here) depending on the
>version of SysV. Furthermore is it VERY unlikely you wouldn't find
>TCGETA and TCSETA in any version of SysV, and thats what ecu is actually
>using (and maybe TCSBRK but thats quite easy to avoid). 

RFS passes ioctl() structs in straight binary.  That means that differences
in byte ordering and field padding will affect operation even though
the termio.h files say the same things.  For example, I have 3B2's
and 386's RFSed together both running AT&T SysVr3.2 and a program on one
cannot ioctl() the devices on the other.  In fact, I haven't been able to
get uucico to work over RFS to a remote device on an identical machine,
although cu will do it on the 386's.

>Regarding lockfiles: no problem here. What could prevent you from
>sharing /usr/spool/locks all over the RFSnet?? As long as the usual
>lockfile format is used I wouldn't expect any fighting for devices.

Several problems.  First you need a unique name for every device
(shared or not) on the net that uses lockfiles, and you have to
make sure that the RFS link is up before you start any of the processes
that use them (like uugetty).  Second, uugetty doesn't remove its
lockfile. How can it - it's gone at the time it should be removed?
So programs that use lockfiles to contend with uugetty check to
see if the locking program is still running by sending signal 0
to the process and checking the status returned from kill().  If
the process is actually on another machine, kill() isn't going to
find it and the program will assume the lockfile is invalid.  The
correct approach here is to use kernel locks since they work over
RFS.  Even on local devices it is the best approach - I've seen
uucico's debug output indicate that it succeeded in obtaining
a lockfile but still failed to get the kernel lock (which really
indicates that the lockfile scheme didn't work).

>Even then I did some (admittedly quick n'dirty:-) solutions by wrapping
>the application into a shell script which creates some locks prior to
>accessing the device.

I'm pretty sure it isn't possible to do locks right in a shell script.
Creating a tmp file and using /etc/link to attempt to rename it to
the agreed-upon lockfile name is OK if it works, but you can never
safely test or remove an existing file.   Some version of ln might
do what you want, but SysVr3 removes the target before attempting the
new link. 

Les Mikesell
  les at chinet.chi.il.us



More information about the Comp.unix.sysv386 mailing list