Bug 16223 - lpd passes undocumented additional arguments to external filters which breaks some of them, including netatalk psf
lpd passes undocumented additional arguments to external filters which breaks...
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: lpr (Show other bugs)
6.2
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Crutcher Dunnavant
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-08-15 05:47 EDT by Need Real Name
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-15 07:28:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2000-08-15 05:47:40 EDT
I have been experiencing some problems with jobs printing endlessly when
using the netatalk
psf/pap facility to drive appletalk laser printers under Redhat 6.2 (lpr
version 0.50).  Typical
syslog looks like:

Aug 11 13:14:54 fangio ifpap[1313]: starting for root
Aug 11 13:14:54 fangio ifpap[1313]: stdin root fangio
Aug 11 13:14:54 fangio ifpap[1313]: accounting with psa[1314]
Aug 11 13:14:54 fangio ifpap[1313]: sending to pap[1315]
Aug 11 13:14:54 fangio ifpap[1313]: PostScript
Aug 11 13:14:58 fangio ifpap[1313]: 1315 done
Aug 11 13:14:58 fangio ifpap[1313]: wait3: No child processes
Aug 11 13:14:58 fangio lpd[1312]: restarting lp
Aug 11 13:14:58 fangio ifpap[1317]: starting for root
Aug 11 13:14:58 fangio ifpap[1317]: stdin root fangio
Aug 11 13:14:58 fangio ifpap[1317]: accounting with psa[1318]
Aug 11 13:14:58 fangio ifpap[1317]: sending to pap[1319]
Aug 11 13:14:58 fangio ifpap[1317]: PostScript
Aug 11 13:15:01 fangio ifpap[1317]: 1319 done
Aug 11 13:15:01 fangio ifpap[1317]: wait3: No child processes
Aug 11 13:15:01 fangio lpd[1312]: restarting lp

Most important observation is that psf thinks that accounting is turned on
- it is not. This starts up a "race" between the accounting process psa
(forked by psf and exiting immediately with nothing to do) and psf, which
is waiting for the accounting process to finish.  psf returns a non-zero
exit code to lpd, which then reforks the job, ad infinitum...  As a campus
which uses appletalk as the defacto printer standard, this is a big
problem.

Thinking something was broken with psf, I hacked it up log the command line
arguments that lpd calls it with:

Aug 11 14:06:24 fangio ifpap[2099]: argument list: -w132 -l66 -i0 -n dcm -h
fangio -j stdin
Aug 11 14:06:24 fangio ifpap[2099]: starting for dcm
Aug 11 14:06:24 fangio ifpap[2099]: psa arguments: stdin dcm fangio
Aug 11 14:06:24 fangio ifpap[2099]: accounting with psa[2100]
Aug 11 14:06:25 fangio ifpap[2099]: sending to pap[2101]
Aug 11 14:06:25 fangio ifpap[2099]: PostScript
Aug 11 14:06:28 fangio ifpap[2099]: 2101 done
Aug 11 14:06:28 fangio ifpap[2099]: wait3: No child processes
Aug 11 14:06:28 fangio lpd[2098]: restarting lp

note the -h and -j options.  These are not described in the bsd lpr
documentation.  psf has been coded to accept any of the bsd lp filter
command line arguments, plus any of the RFC 1179 job control characters.
Lowercase j is not either of those.  This leads psf to believe an
accounting file has been passed and that accounting is on, leading to the
fork of psa and leading on to the abovementioned problem.  The offending
code is in printjob.c around line 698:


   689          if ((av[0] = strrchr(prog, '/')) != NULL)
   690                  av[0]++;
   691          else
   692                  av[0] = prog;
   693          av[n++] = "-n";
   694          av[n++] = logname;
   695          av[n++] = "-h";
   696          av[n++] = fromhost;
   697  
   698          /* Add Jobname */
   699          if (jobname[0] && (jobname[0] != ' ')) {
   700                  av[n++] = "-j";
   701                  av[n++] = jobname;
   702          }
   703  
   704          /* Add Extended Parms */
   705          if (extparms[0] && (extparms[0] != ' ')) {
   706                  av[n++] = "-z";
   707          av[n++] = extparms;
   708          }

As a work around I have modified psf to accept -j as an arguments, but it
is not particularly satisfactory.  Better would be sort out what lpd should
send to filters and what filters should expect from lpd.

FYI I also have a Redhat 6 derived PPC linux port (Yellow dog linux
champion server 1.2) which exhibits identical problems.  Earlier redhat 5
based systems do not exhibit this problem.
Comment 1 Crutcher Dunnavant 2000-10-01 11:27:30 EDT
This is between following a loose 'standard' (as the RFC in question is an after
the fact description), and providing some more accounting information.

Some of the other filters require this information for proper operation, and I
can't really zap it.
Might I suggest a thin shell wrapper to eat those options? Such a program will
probably be necessary to use netatalk with the LPRng system that rides with Red
Hat Linux 7, as it provides files, rather than stdin spools.

Note You need to log in before you can comment on or make changes to this bug.