Bug 58113

Summary: lpr won't print: can't install text-only printer
Product: [Retired] Red Hat Linux Reporter: Need Real Name <ghunter>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-01-21 22:39:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
installation log none

Description Need Real Name 2002-01-08 23:02:38 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.08 [en] (WinNT; U ;Nav)

Description of problem:
The command
                                  lpr /etc/hosts produces the error message
                                     "sending job 'root@localhost+13@ to TextOnly@localhost
                                     connecting to localhost, attempt 1
                                     cannot open connection to localhost - Network is unreachable
                                     Make sure LPD server is running on the server"
    and lpd is indeed running. 

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.install text-only printer
2.print test message (fails - detects an error)
3.lpr <filename>
	

Actual Results:  1. "lpd sucessfully restarted"
2. "an error ocurred"
3. error message as in description

Expected Results:  2. no error message, and a test file printed
3.  the specified file printed

Additional info:

  See service request 196845 for more details

Comment 1 Tim Waugh 2002-01-09 07:37:26 UTC
What does '/sbin/ifconfig lo' say?


Comment 2 Need Real Name 2002-01-09 21:47:35 UTC
/sbin/ifconfig lo

responds

lo        Link encap:Local Loopback
          LOOPBACK  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Comment 3 Tim Waugh 2002-01-10 09:24:31 UTC
And '/sbin/route -n'?


Comment 4 Need Real Name 2002-01-10 17:21:44 UTC
/sbin/route -n 

responds

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

Comment 5 Tim Waugh 2002-01-10 17:24:04 UTC
Network problem, not LPRng problem.  Reassigning to initscripts (for want of a 
better place).


Comment 6 Bill Nottingham 2002-01-11 00:28:05 UTC
What does /etc/sysconfig/network-scripts/ifcfg-lo say?

Comment 7 Need Real Name 2002-01-11 17:13:03 UTC
Contents of  /etc/sysconfig/network-scripts/ifcfg-lo 

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

Comment 8 Need Real Name 2002-01-17 14:40:00 UTC
Created attachment 42694 [details]
installation log

Comment 9 Need Real Name 2002-01-17 14:40:51 UTC
I think I see a possible explanation for this problem.

The system is intended for use as a stand alone word processor, with no
network connection of any kind.  It has therefore been installed with very
few network components - perhaps too few.  I therefore attach the
installation log in case it gives you a clue as to what, if anything, is
missing, and why it wasn't picked up by the dependancy checks.

Comment 10 Brock Organ 2002-01-21 15:59:46 UTC
I am seeing the behavior you describe when trying to print without a loopback 
device (your output from ifconfig above shows a loopback device that is not 
enabled)

Can you explicitly bring up the loopback (lo) device successfully, then retry 
your print job? 

Here is a sample root session to illustrate what I mean:

# ifconfig lo
lo        Link encap:Local Loopback  
          LOOPBACK  MTU:16436  Metric:1
          RX packets:3199 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3199 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 
          RX bytes:246400 (240.6 Kb)  TX bytes:246400 (240.6 Kb)

# lpr /etc/hosts
Status Information:
 sending job 'root@borgan+992' to devel@localhost
 connecting to 'localhost', attempt 1
 cannot open connection to localhost - Connection timed out
Make sure LPD server is running on the server
# ifup lo; echo $?
0
# lpr /etc/hosts
# lpq
Printer: devel@borgan (dest /var/spool/lpd/lp0.redhat.com)
 Queue: no printable jobs in queue
 Status: job 'cfA100borgan.devel.redhat.com' removed at 10:53:23.384
JetDirect lpd: no entries
# 

As you can see the first lines show the loopback (lo) device as being off, and 
the print job fails ... then using the "ifup lo" command (and checking that it 
exited with a 0 value using "echo $?") I turned the loopback (lo) device on, 
then my print jobs were able to be printed ...

what I am interested in is if you are able to print after running the command 

# if lo; echo $?




Comment 11 Brock Organ 2002-01-21 16:36:39 UTC
I'm sorry, I made a typo above, I meant to say the command:

# ifup lo; echo $?

and not

# if lo; echo $?


Comment 12 Need Real Name 2002-01-21 22:38:55 UTC
ifup lo; echo$?

works! lpr <filename> works, and test printing from printtool appears to work.

If I add the ifup command to a start up script, will that provide a satisfactory workaround?


Comment 13 Brock Organ 2002-01-22 13:49:50 UTC
Yes, you could add that to a start up script, but try changing the "ONBOOT=" 
line in the file /etc/sysconfig/network-scripts/ifcfg-lo to "ONBOOT=yes" first 
...

For example here is my file, and my lo device is started automatically at boot 
because of the "ONBOOT=" value:

$ cat /etc/sysconfig/network-scripts/ifcfg-lo 
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
$ 

I am happy you are able to print now ... not having the loopback device 
running at startup is an unusual condition, which may be why your problem was 
not easily diagnosed ...

good luck! :)



Comment 14 Brock Organ 2002-01-22 13:55:07 UTC
doh! :)

I see your ifcfg-lo file DOES have ONBOOT=yes in it ... I'm not sure why your 
lo device is not starting up automatically at boot, so until that reason is 
known and can get fixed, putting the ifup command in a start up script will 
provide a work around ... :)



Comment 15 Need Real Name 2002-02-02 08:54:13 UTC
I think I have discovered why lo is not starting automatically at start up.  I have (had) the network service disabled because (a) I didn't think I needed 
it, as I have no network (b) it was slowing the boot process by looking for a non-existant eth0 device.  I have now enabled it and lo starts on boot.

I cannot get the ifup command to work from a script - it hangs the system with "fork: resource temporarily unavailable" messages.