Bug 7488 - Remote printing problems in Red Hat 6.1
Summary: Remote printing problems in Red Hat 6.1
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: lpr
Version: 6.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-12-01 17:55 UTC by Tim Herwig
Modified: 2008-05-01 15:37 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2000-07-17 15:16:28 UTC

Attachments (Terms of Use)

Description Tim Herwig 1999-12-01 17:55:36 UTC
The following problem has began occuring
on RedHat 6.1 Linux.

When attempting to print from a Linux box
to a remote printer attached to a Windows
NT host, the following message appears:

    lpr: connect: Connection refused
    jobs queued, but cannot start daemon.

The print command is:

    lpr -Plp1 -l [filename]

I get the same message when using the printtool
utility or going into lpc and issuing various
instructions (restart, start, up).  Still, at
system startup/shutdown, the lpd daemon starts
and stops just fine.

Needless to say, spoolfiles are created but nothing

FYI, When I finished installing Red Hat Linux 6.1 this
command and printtool seemed to work ok.  I even managed
to successfully print from Netscape by placing the same
command in the print dialog.  The only thing I have done
between the time it was working and now was install and
configure (Red Had did most of the configuring automatically)
a US Robotics 56K modem which is working fine.  Along with the
modem I installed a proxy server.  I don't know if this could
have contributed to the problem, but I thought you should know.

I have not added any packages or modified the Linux Kernel
in any way.  Also, I have noticed that there are numerous
reports of the same problem appearing at various on-line
discussion groups.

*** One thing in particular stands out here.  When printing was
working properly a 'netstat -an' reported a dev/printer listening
on a particular port.  When printing fails with the above error,
'netstat -an' shows no such listing (See attached documents below).
This may boil down to determining how to get the proper listener
up and running.

I have discussed this with Red Hat support and they
suggested installing the lpr-0.46-1.i386.rpm package
and adding the following line to my /etc/conf.modules file:

     alias parport_lowlevel parport_pc

Neither fix had any effect on the problem so they next
suggested I file a bug report.

Enclosed Files:


Enclosed command output:

  ps -x | grep lpd
  route -n
  netstat -an

netstat -an (Working ok)

unix 0 [ ACC ] STREAM LISTENING 1004 /tmp/orbit-root/orb-262429146688742165
unix 0 [ ACC ] STREAM LISTENING 506  /dev/gpmctl
unix 0 [ ACC ] STREAM LISTENING 854  /tmp/orbit-root/orb-683281291975554655
unix 0 [ ACC ] STREAM LISTENING 1015
unix 0 [ ACC ] STREAM LISTENING 607  /tmp/.X11-unix/X0
unix 0 [ ACC ] STREAM LISTENING 547  /tmp/.font-unix/fs-1
unix 0 [ ACC ] STREAM LISTENING 636  /tmp/.ICE-unix/606
unix 0 [ ACC ] STREAM LISTENING 798  /tmp/orbit-root/orb-172696057828298034
unix 0 [ ACC ] STREAM LISTENING 838  /tmp/orbit-root/orb-866851993202941663
unix 0 [ ACC ] STREAM LISTENING 1183 /dev/printer

netstat -an (Failed)

unix 0[ ACC ] STREAM LISTENING 1004 /tmp/orbit-root/orb-262429146688742165
unix 0 [ ACC ] STREAM LISTENING 506  /dev/gpmctl
unix 0 [ ACC ] STREAM LISTENING 854  /tmp/orbit-root/orb-683281291975554655
unix 0 [ ACC ] STREAM LISTENING 1015
unix 0 [ ACC ] STREAM LISTENING 607  /tmp/.X11-unix/X0
unix 0 [ ACC ] STREAM LISTENING 547  /tmp/.font-unix/fs-1
unix 0 [ ACC ] STREAM LISTENING 636  /tmp/.ICE-unix/606
unix 0 [ ACC ] STREAM LISTENING 798  /tmp/orbit-root/orb-172696057828298034
unix 0 [ ACC ] STREAM LISTENING 838  /tmp/orbit-root/orb-866851993202941663
unix 0 [ ACC ] STREAM LISTENING 718 /tmp/orbit-root/orb-1574627081874360890

# /etc/printcap
# Please don't edit this file directly unless you know what you are doing!
# Be warned that the control-panel printtool requires a very strict format!
# Look at the printcap(5) man page for more info.
# This file can be edited with the printtool in the control-panel.
	:cm=HP LaserJet 1100:\
##PRINTTOOL3## SMB laserjet 300x300 letter {} LaserJet Default {}
##PRINTTOOL3## SMB laserjet 300x300 letter {} LaserJet Default {}

ps -x | grep lpd

root       722     1  0 02:00 ?        00:00:00 lpd
root       723   722  0 02:00 ?        00:00:00 lpd
root       741   665  0 02:03 pts/0    00:00:00 grep lpd

route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface UH    0      0        0
eth0   U     0      0        0
eth0       U     0      0        0 lo         UG    0      0        0


eth0      Link encap:Ethernet  HWaddr 00:60:08:CD:2F:FF
          inet addr:  Bcast:  Mask:
          RX packets:1339 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1339 errors:0 dropped:0 overruns:0 carrier:0
          collisions:102 txqueuelen:100
          Interrupt:11 Base address:0x1040

lo        Link encap:Local Loopback
          inet addr:  Mask:
          UP LOOPBACK RUNNING  MTU:3924  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0

# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not many any basic syntactic errors.
#======================= Global Settings

# workgroup = NT-Domain-Name or Workgroup-Name
;  workgroup = MYGROUP
   workgroup = ALIEN.COM

# server string is the equivalent of the NT Description field
   server string = Samba Server

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
;   hosts allow = 192.168.1. 192.168.2. 127.
    hosts allow = 172.16.1.

# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
   printcap name = /etc/printcap
   load printers = yes

# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
;   printing = bsd

# Uncomment this if you want a guest account, you must add this to
# otherwise the user "nobody" is used
;  guest account = pcguest

# this tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Put a capping on the size of the log files (in Kb).
   max log size = 50

# Security mode. Most people will want user level security. See
# security_level.txt for details.
   security = user
;  security = server
# Use password server option only with security = server
;   password server = <NT-Server-Name>
;   password server = mother.alien.com

# Password Level allows matching of _n_ characters of the password for
# all combinations of upper and lower case.
;  password level = 8
;  username level = 8

# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
   encrypt passwords = yes
   smb passwd file = /etc/smbpasswd

# The following are needed to allow password changing from Windows to
# update the Linux sytsem password also.
# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
# NOTE2: You do NOT need these to allow workstations to change only
#        the encrypted SMB passwords. They allow the Unix password
#        to be kept in sync with the SMB password.
;  unix password sync = Yes
;  passwd program = /usr/bin/passwd %u
;  passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n

# Unix users can map to different SMB User names
;  username map = /etc/smbusers

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
;   interfaces =

# Configure remote browse list synchronisation here
#  request announcement to, or browse list sync from:
#	a specific host or from / to a whole subnet (see below)
;   remote browse sync =
# Cause this host to announce itself to local subnets here
;   remote announce =

# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
;   local master = no

# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
;   os level = 33

# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
;   domain master = yes

# Preferred Master causes Samba to force a local browser election on
# and gives it a slightly higher chance of winning the election
;   preferred master = yes

# Use only if you have an NT server on your network that has been
# configured at install time to be a primary domain controller.
;   domain controller = <NT-Domain-Controller-SMBName>

# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
;   domain logons = yes

# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
;   logon script = %m.bat
# run a specific logon batch file per username
;   logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)
#        %L substitutes for this servers netbios name, %U is username
#        You must uncomment the [Profiles] share below
;   logon path = \\%L\Profiles\%U

# All NetBIOS names must be resolved to IP Addresses
# 'Name Resolve Order' allows the named resolution mechanism to be
# the default order is "host lmhosts wins bcast". "host" means use the unix
# system gethostbyname() function call that will use either /etc/hosts OR
# DNS or NIS depending on the settings of /etc/host.config,
# and the /etc/resolv.conf file. "host" therefore is system configuration
# dependant. This parameter is most often of use to prevent DNS lookups
# in order to resolve NetBIOS names to IP Addresses. Use with care!
# The example below excludes use of name resolution for machines that are
# on the local network segment
# - OR - are not deliberately to be known via lmhosts or via WINS.
  name resolve order = wins lmhosts bcast

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS
;   wins support = yes

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
#	Note: Samba can be either a WINS Server, or a WINS Client, but NOT
;   wins server = w.x.y.z
    wins server = uxm5v.alien.com

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one	WINS Server on the network. The default is NO.
;   wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
   dns proxy = no

# Case Preservation can be handy - system default is _no_
# NOTE: These can be set on a per share basis
;  preserve case = no
;  short preserve case = no
# Default case is normally upper case for all DOS files
;  default case = lower
# Be very careful with case sensitivity - it can break things!
;  case sensitive = no

#============================ Share Definitions
   comment = Home Directories
   browseable = no
   writable = yes

# Un-comment the following and create the netlogon directory for Domain
    comment = Network Logon Service
    path = /home/netlogon
    guest ok = yes
    writable = no
    share modes = no

# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;    path = /home/profiles
;    browseable = no
;    guest ok = yes

# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
   comment = All Printers
   path = /var/spool/samba
   browseable = no
# Set public = yes to allow user 'guest account' to print
   guest ok = no
   writable = no
   printable = yes

# This one is useful for people to share files
   comment = Temporary file space
;  path = /tmp
   path = /
   read only = no
   public = yes

# A publicly accessible directory, but read only, except for people in
# the "staff" group
;   comment = Public Stuff
;   path = /home/samba
;   public = yes
;   writable = yes
;   printable = no
;   write list = @staff

# Other examples.
# A private printer, usable only by fred. Spool data will be placed in
# home directory. Note that fred must have write access to the spool
# wherever it is.
;   comment = Fred's Printer
;   valid users = fred
;   path = /homes/fred
;   printer = freds_printer
;   public = no
;   writable = no
;   printable = yes

# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;   comment = Fred's Service
;   path = /usr/somewhere/private
;   valid users = fred
;   public = no
;   writable = yes
;   printable = no

# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %u option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;  comment = PC Directories
;  path = /usr/pc/%m
;  public = no
;  writable = yes

# A publicly accessible directory, read/write to all users. Note that all
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of
# be specified, in which case all files would be owned by that user
;   path = /usr/somewhere/else/public
;   public = yes
;   only guest = yes
;   writable = yes
;   printable = no

# The following two entries demonstrate how to share a directory so that
# users can place files there that will be owned by the specific users. In
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended
# as many users as required.
;   comment = Mary's and Fred's stuff
;   path = /usr/somewhere/shared
;   valid users = mary fred
;   public = no
;   writable = yes
;   printable = no
;   create mask = 0765

Comment 1 Freerk J. Bosscha 1999-12-02 12:42:59 UTC
I have noticed the same problem on my site.
We are using quit a number op hp with JetDirect interface cards in it.
There is although one printer which does work fine, and I was wondering if the
firmware of the JetDirect card could possible be the problem.
Running on a SCO-box with the hpnpf software is no problem.

Could you please indicate if this could be the problem of a fireware level.

HP Ethernet Multi-Environment
Firmware-revision   A.03.03           Works
Firmware-revision   A.02.01           Works not.

F.J. Bosscha

Comment 2 Alfred Reibenschuh 2000-02-02 17:16:59 UTC
I have similar problems with both a RH5.2 and a clean RH6.1 install.
In both cases the linux-server has samba 2.0.5a installed and is sharing
a printer attached to the network thru a "AXIS NPS 550" box on the same subnet.

Things getting really weird if printing to the lp-queue from a Solaris 2.6
or AIX is tried, the lpd refusing any connection attempts and exits.

I tried installing the openbsd-lp-1.0 package in the RH5.2 which showed similar
troubles, on the RH6.1 it wouldn't even compile.

Comment 3 Samuli Kärkkäinen 2000-03-22 21:04:59 UTC
It seems to me that the bug described by debian bug #40842
(http://cgi.debian.org/cgi-bin/bugreport.cgi?bug=40842&archive=yes) still exists
in Redhat lpr rpm, even in the newest one in 6.2beta. This bug causes
/dev/printer to disappear when lpd can't connect remote lpd, which in turn makes
lpr say

  lpr: connect: Connection refused
  jobs queued, but cannot start daemon.

when printing is attempted. This is apparently fixed in current Debian.

When this situation occurs, it can be worked around by fixing the remote lpd,
manually recreating /dev/printer as

  srw-------   1 root     root            0 Mar 20 13:56 /dev/printer=

and then restarting lpd.

Comment 4 daniel.deimert 2000-05-02 17:05:59 UTC
This may be the same as bug as numerous others in bugzilla, such as #5540,
#9084, #10070, #10076

I can always reproduce this behaviour on 6.1 with lpr-0.50-4 by doing:

	/etc/rc.d/init.d/lpd restart

While doing this, I straced the lpd:

select(20, [5 6], NULL, NULL, NULL)     = ? ERESTARTNOHAND (To be restarted)
--- SIGTERM (Terminated) ---
brk(0x8062000)                          = 0x8062000
time([957282620])                       = 957282620
getpid()                                = 12050
rt_sigaction(SIGPIPE, {0x2ab70bf0, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<54>May  2 17:50:20 lpd[12050]: "..., 39, 0) = 39
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
unlink("/dev/printer")                  = 0
--- SIGCHLD (Child exited) ---
_exit(0)                                = ?

Note the unlink() of /dev/printer.

Now I did:

root@picard:lpd# /etc/rc.d/init.d/lpd start
Starting lpd:                                              [  OK  ]
root@picard:lpd# ps -axuf |grep lpd
root     15124  0.0  0.0  1152  440 ?        S    18:54   0:00 lpd -l
root     15132  0.0  0.0  1468  812 ?        S    18:54   0:00  \_ lpd -l

root@picard:lpd# strace -p 15124
wait4(15132,  <unfinished ...>
root@picard:lpd# strace -p 15132

The read() never exits.

Doing "lpc abort all" kills the child, 15132, and thus the parent can exit
the wait4().

A "lpc start all" now makes printing work again.

I note that this bug has been open since 1999-12, that is four months!

Comment 5 Bernhard Rosenkraenzer 2000-07-17 15:16:26 UTC
This is fixed in rawhide with the move to LPRng.

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