[comp.sys.encore] lpd woes

clyde@ut-emx.uucp (Head UNIX Hacquer) (01/12/91)

The program 'psnf' is really a shell script with multiple links (at
least it is in our version of TranScript).  This script can be modified
to dump the stderr into the log file in the following manner:

#
# Redirect stderr to the log file by hand to get around the 4.3 LPD's handling
# of error output.  Use pcget to get the lf entry from printcap if available,
# else use ${pname}-log in the current directory.
#
if [ -x /usr/local/etc/pcget ] ; then
	cwd=`pwd`
	pname=`basename $cwd`
	lf=`/usr/local/etc/pcget -P$pname lf`
else
	wd=`pwd`
	lf=`basename $wd`-log
fi
exec 2>>$lf

We have a script 'pcget' that does printcap lookups. 
If you use the convention of naming the log file "<printername>-log", then
the basename trick can be used.  We do this for all of our lpds,
including that on our UMAX 4.3 system.

john@loverso.leom.ma.us (John Robert LoVerso) (01/14/91)

In an article, Tim Perala writes:
> One problem is that lpd no longer puts the stderr of the
> input filter (if) into the log file (lf) as defined in
> /etc/printcap.  It does appear that the output filter (of)
> does write its stderr to the log file as with 4.2, but
> the stderr of the input filter gets put into the spool
> directory under the name "errsXXXXX", where XXXXX is the
> pid of the filter.

This isn't a change that Encore made.  It just reflects how lpd was
changed in 4.3BSD (circa 1985).  UMAX4.3 just includes the 4.3BSD
(or the -tahoe) version of lpd now.

A quick glance at the code shows that the errsXXXXX file (which indeed
is just the errors from the filter program) is only referenced when the
user requests that notification of job status be returned via mail.
This is quite silly.  A second glance at the 4.3BSD-reno code shows
that the problem has been fixed by adding a wee bit of code to copy
the contents of the errsXXXXX file to the end of the lf file after
the filter completes.

A quick hack to fix this is to change the filter into a shell script
that opens up a different stderr (in later versions of TranScript,
the psXf programs are all links to a single shell script).  Alternately,
you could just install the 4.3BSD-reno lpd (ftp'able from the bsd-sources
tree on uunet.uu.net; the source has been freely redistributable since
the `tahoe' release).  The ANNEX-UX patches for `ra' and `al' should
be easily applied (if you need those features).

John
-- 
John Robert LoVerso <john@loverso.leom.ma.us>
John & Sue's House, Leominster MA
[to reach the corporate puppet: loverso@westford.ccur.com]