Bug 5835 - Remote printing problem with lpd
Remote printing problem with lpd
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: lpr (Show other bugs)
6.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
: 5697 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-10-11 11:08 EDT by marinell
Modified: 2014-03-16 22:10 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-10-20 15:46:12 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 marinell 1999-10-11 11:08:59 EDT
I have a central print server for the UNIX systems that I
manage in my department. It collects print jobs from client
systems and sends them off to the apropriate printers.

Printing for clients upgraded to RedHat 6.1 fails to work.
The lpd daemon in RedHat 6.1 does not seem to transfer the
job to the remote print server. (I.E. logging on the print
server's lpd does not show any activity from a RedHat 6.1
print job)

Loading an older lpd binary from an another RedHat Linux
distribution (6.0 or 5.2) corrects the printing problem.
Comment 1 Bill Nottingham 1999-10-11 11:20:59 EDT
Can you try the lpr RPMs at

http://people.redhat.com/notting/lpr/
-or-
ftp://people.redhat.com/notting/lpr/

and let me know if they work for you?
Comment 2 Bill Nottingham 1999-10-11 11:35:59 EDT
OK, silly question; lpr was restarted after install, correct?

Are there stale print files hanging around in the queue on the
clients?

What does the /etc/printcap on the clients look like?

What sort of print server is the main server?
Comment 3 ptak 1999-10-14 13:03:59 EDT
I had the same problem, upgrading with the RPM listed below worked.
Comment 4 Bill Nottingham 1999-10-14 17:11:59 EDT
*** Bug 5697 has been marked as a duplicate of this bug. ***

with lpr-0.41-2 package distributed with rh6.1 the
network printing does not work. The jobs go to the
queue on the server but never come out (most likely
due to corrupt control files originating from the
client - see below).

It appears that the problem is in lpd/printjob.c
in function sendit(). The bug is somehow related to the
creation of the control file copy. If I remove the
control file copy code (which is forced in the current
version) then the printing begins to work.

------- Additional Comments From notting@redhat.com  10/07/99 17:33 -------
Could you try the lpr package from Raw Hide
(ftp://ftp.redhat.com/pub/rawhide/) and let us know if that
works better for you?  Remote printing works OK here...

------- Additional Comments From   10/08/99 03:54 -------
I had the same problem printing from a 6.1 box to a 6.0 box. after
downgrading lpr to the package in 6.0, everything works. I use
hosts.equiv authorization on the server.

------- Additional Comments From eloranta@jyu.fi  10/08/99 03:58 -------
Using lpr-0.41-3 from rawhide solves the problem here.


------- Additional Comments From stoty@tvnet.hu  10/08/99 04:07 -------
I confirm, lpr-0.41-3 solves this problem for me, too.

------- Additional Comments From steveh@eecs.umich.edu  10/08/99 04:15 -------
lpr-0.41-3 only partially fixes the problem. The current solution
will not work for multiple copies.

------- Additional Comments From steveh@eecs.umich.edu  10/08/99 04:19 -------
Here is what I think is a more elegant solution to the problem. I'm
not sure I can paste a patch on this little box on the bugtraq web
page, but here goes... (I'm also submitting a similar patch to Debian
lpr, which is also based off of Redhat's 0.41 lpr; I'm actually a
Debian user <grin>). If this doesn't paste well and you're interested
in it, email me privately and I'll resend it.

--- ../lpr-0.41/lpd/printjob.c  Wed Sep 29 13:05:11 1999
+++ lpd/printjob.c      Fri Oct  8 03:45:14 1999
@@ -756,7 +756,6 @@ sendit(file)
        int  ifchild, pid;
        int  sendresult;
        int  tmpmask;
-       int  numcopies=0;

        int  ii;

@@ -875,16 +874,22 @@ sendit(file)

                        strcpy(last, line);
                        /* handle multiple copies */
-                       while (i = getline(cfp))
+                       while (i = getline(cfp)) {
+                         if (dup_cfp)
+                           fprintf(dup_cfp, "%s\n", line);
                                if (strcmp(last, line))
                                        break;
-                               else
-                                       numcopies++;
+                       }


                        /* msf - here is where we hack in IF
support    */
                        /*       will only run the IF, no other
filters */
                        /*       will be
run.                           */
+                       /* This hack will work for multiple files
only  */
+                       /* if the 'f' lines are separated by at
least   */
+                       /* one non-'f' line (i.e. a U or N line) due
to */
+                       /* the multiple copies getline() while
loop     */
+                       /* right above this
comment.                    */
                        if (IF != NULL && last[0] == 'f') {

                            memcpy(tmpfile, last+1, 7);
@@ -895,11 +900,6 @@ sendit(file)
                            /* Nasty trick of the day, to attempt
                             * to be RFC compliant */
                            rename(last+1,tmpfile);
-                           /* we make a new f and U entry for remote
cfp */
-
-                           for (;numcopies>0;numcopies--)
-                                 fprintf(dup_cfp, "f%s\n",last+1);
-                           fprintf(dup_cfp, "U%s\n",last+1);

                            fi = open(tmpfile, O_RDONLY);
                            ifi = open
(last+1,O_WRONLY|O_CREAT|O_TRUNC, 0664);
@@ -918,11 +918,6 @@ sendit(file)
                          /* wait on it to finish */
                          waitpid(ifchild, NULL, 0);
                         }
-                        else
-                        {
-                         if (dup_cfp)
-                           fprintf(dup_cfp, "%s\n", line);
-                         }

                         sendresult = sendfile('\3', last+1);




------- Additional Comments From notting@redhat.com  10/08/99 13:37 -------
OK, could you try the lpr-0.42-1 RPMs at
ftp://people.redhat.com/notting/lpr/
-or-
http://people.redhat.com/notting/lpr/

to make sure it still works for everyoone?  It checks out fine here...

------- Additional Comments From eloranta@jyu.fi  10/09/99 11:23 -------
lpr-0.42-1 works ok here.


------- Additional Comments From   10/14/99 06:45 -------
I had the same problem. lpr-0.42-1 seems to fix it.
Comment 5 Bill Nottingham 1999-10-17 23:21:59 EDT
This should be fixed in the lpr-0.43-2 errata release.
Comment 6 Lance A. Brown 1999-10-19 13:35:59 EDT
I'm also experiencing problems printing from an RH 6.0 -> 6.1 upgraded
system to a centralized Windows NT print server providing lpd
services.

Upgraded to lpr-0.43-2 with no success.  Downgraded to lpr RPM shipped
on RH 6.0 CD with no success either.  Installed 0.43-2 again, removed
all entries from /etc/printcap and deleted all files and dirs in
/var/spool/lpd.  Used printtool to create new queue for remote printer
that worked before upgrade.  Print jobs still refuse to move from
local system to remote system.

lpq returns:

brown9@splat:~ $ lpq

splat.niehs.nih.gov: Warning: no daemon present
Rank   Owner      Job  Files                                 Total
Size
1st    root       0     ...                                  16408
bytes


                         Windows NT LPD Server
                              Printer \\157.98.XX.YY\bigelow

Owner       Status         Jobname          Job-Id    Size   Pages
Priority
----------------------------------------------------------------------------


and

/var/log/messages receives:

Oct 19 13:27:53 splat lpd[29888]: restarting lp
Oct 19 13:27:53 splat lpd[29888]: lp: status: Permission denied

when I use lpc to restart the queues.
Comment 7 Bill Nottingham 1999-10-19 14:19:59 EDT
What's the permissions on the spool directory?
Comment 8 Lance A. Brown 1999-10-19 16:06:59 EDT
Permissions and ownership are as follows:

/var/spool/lpd:
drwxrwxr-x   3 root     daemon       1024 Oct 19 13:27 lpd/

/var/spool/lpd/*
drwxr-xr-x   2 root     lp           1024 Oct 19 13:27 lp/
-rw-r--r--   1 root     root            6 Oct 19 13:27 lpd.lock
Comment 9 Bill Nottingham 1999-10-19 16:28:59 EDT
Are there any lpd processes running at all?  What happens
if you do /etc/rc.d/init.d/lpd restart, as opposed to restarting
with lpc?

------- Additional Comments From   10/19/99 18:07 -------
here are the cf spool files on a remote system
that the redhat system is spooling to. 35 works
41 and 43 do not. notice the missing H from the
non-working control files. according to rfc1179
this is a required field.

hummmm...

35
--------
Hbaur
Pecb
Jprintcap
Cbaur
Lecb

K1
O -oBSDJprintcap -oBSDCbaur
FdfA025baur
fdfA025baur
UdfA025baur
N/etc/printcap



41
------
Proot
Jprintcap
UdfA006
N/etc/printcap

43-1
-----
Proot
Jtestpage.asc
B
K1
O -oBSDJtestpage.asc
FdfA005
fdfA005
UdfA005
N/usr/lib/rhs/rhs-printfilters//testpage.asc
Comment 10 Bill Nottingham 1999-10-19 18:13:59 EDT
Grr. Arrg. Typo.

Fixed in lpr-0.43-3.
Comment 11 Lance A. Brown 1999-10-20 07:43:59 EDT
Running /etc/rc.d/init.d/lpd restart gets the same error 'lpc restart
all':

from /var/log/messages:

Oct 20 07:40:25 splat lpd: lpd shutdown succeeded
Oct 20 07:40:26 splat lpd: lpd startup succeeded
Oct 20 07:40:29 splat lpd[15972]: restarting lp
Oct 20 07:40:29 splat lpd[15972]: lp: status: Permission denied

Immediately after the restart lpq shows:

brown9@splat:/var/spool/lpd $ lpq
splat.niehs.nih.gov: sending to print.niehs.nih.gov
Rank   Owner      Job  Files                                 Total
Size
1st    brown9     1    foo                                   1201
bytes


                         Windows NT LPD Server
                              Printer \\157.98.XX.YY\bigelow

Owner       Status         Jobname          Job-Id    Size   Pages
Priority
----------------------------------------------------------------------------

and then it shows:

brown9@splat:/var/spool/lpd $ lpq

splat.niehs.nih.gov: Warning: no daemon present
Rank   Owner      Job  Files                                 Total
Size
1st    brown9     1    foo                                   1201
bytes


                         Windows NT LPD Server
                              Printer \\157.98.XX.YY\bigelow

Owner       Status         Jobname          Job-Id    Size   Pages
Priority
----------------------------------------------------------------------------
Comment 12 Lance A. Brown 1999-10-20 07:59:59 EDT
Please disregard my last update.  I just installed lpr-0.44-1 from
updates.redhat.com and am now getting the following when I
'/etc/rc.d/init.d/lpd restart'

/var/log/messages gets:
Oct 20 07:57:36 splat lpd: lpd shutdown succeeded
Oct 20 07:57:36 splat lpd: lpd startup succeeded

and lpq now reports:

brown9@splat:~ $ lpq
splat.niehs.nih.gov: Warning: lp is down: sending to
print.niehs.nih.gov

splat.niehs.nih.gov: Warning: no daemon present
Rank   Owner      Job  Files                                 Total
Size
1st    brown9     1    foo                                   1201
bytes
2nd    brown9     2    netscape.ps                           27479
bytes


                         Windows NT LPD Server
                              Printer \\157.98.XX.YY\bigelow

Owner       Status         Jobname          Job-Id    Size   Pages
Priority
----------------------------------------------------------------------------

The cf* files now have a proper 'H' line.
Comment 13 Lance A. Brown 1999-10-20 12:58:59 EDT
Running /etc/rc.d/init.d/lpd restart gets the same error 'lpc restart
all':

from /var/log/messages:

Oct 20 07:40:25 splat lpd: lpd shutdown succeeded
Oct 20 07:40:26 splat lpd: lpd startup succeeded
Oct 20 07:40:29 splat lpd[15972]: restarting lp
Oct 20 07:40:29 splat lpd[15972]: lp: status: Permission denied

Immediately after the restart lpq shows:

brown9@splat:/var/spool/lpd $ lpq
splat.niehs.nih.gov: sending to print.niehs.nih.gov
Rank   Owner      Job  Files                                 Total
Size
1st    brown9     1    foo                                   1201
bytes


                         Windows NT LPD Server
                              Printer \\157.98.XX.YY\bigelow

Owner       Status         Jobname          Job-Id    Size   Pages
Priority
----------------------------------------------------------------------------

and then it shows:

brown9@splat:/var/spool/lpd $ lpq

splat.niehs.nih.gov: Warning: no daemon present
Rank   Owner      Job  Files                                 Total
Size
1st    brown9     1    foo                                   1201
bytes


                         Windows NT LPD Server
                              Printer \\157.98.XX.YY\bigelow

Owner       Status         Jobname          Job-Id    Size   Pages
Priority
----------------------------------------------------------------------------
Comment 14 Bill Nottingham 1999-10-20 13:03:59 EDT
Hmm... could you strace -f the running lpd process and see what
happens when it tries to restart to send the data?
Comment 15 Lance A. Brown 1999-10-20 13:58:59 EDT
Sent email to notting@redhat.com containing output of 'strace -f
-pLPDPID'.

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