mgetty won't see the modem after the first call

Eric Veldhuyzen (eric@terra.telemediair.nl)
Mon, 18 Oct 1999 15:39:40 +0200


Gert Doering wrote:
> 
> Hi,
> 
> On Mon, Oct 18, 1999 at 02:46:43PM +0200, Eric Veldhuyzen wrote:
> > > Then send the last few hundred lines of the output to us... (the part
> > > showing the mgetty PID only).
> > 
> > [some time later]
> > Hmm... Is it possible that mgetty for some reason is very confused if
> > the logfile it writes to isn't a real normal file but a named pipe? I
> > just removed the named pipe that I was using for logging an replaced it
> > with an empty file, and suddenly I can't reproduce the problem. And this
> > is the only thing I've changed....
> 
> Ummm, yes, this explains things.  The unix pipe semantics say "if you
> open a named pipe for writing, the open() call blocks until another
> process opens the pipe for reading".  Most likely, the reader process
> went away after the first mgetty died, and so there is no reader for the
> second mgetty -> lockup in open().

Hmm. tricky. Didn't know this. But I am glad that I've finally solved
this problem. It is very frustrating to have a problem that seems to be
impossible to solve.

> > Then the only problem I will have is how I can get the logging to a
> > remote system. The ram disk isn't big enough for logging locally.
> 
> I'll add a patch to have the log file name defined in the config file (I
> don't really like this, but there is no way to solve your problem without
> resorting to even more ugly things).

Thanks, that would be a great help.

> [Oh, as a side note: using the same file for different processes should
> *not* be a problem.  The log file is opened with O_APPEND, so all lines
> should be appended atomically.  Dunno whether that works over NFS...]

NFS is a problem, but I guess the only solution I've got. I'll have to
run mgetty not as root but as another user, because NFS doesn't like
root very much. But I guess it's actually a good thing that I am now
forced to change it. :-)

-- 
#!perl #                       Life ain't fair, but root passwords help.
# Eric Veldhuyzen                              eric@terra.telemediair.nl
$!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~                   # Perl Monger
/.(.)...(.)(.)....(.)..(.)..(.)/;`$^$~$/$: $^$*$@$~ $_>&$;`