Tech Support > Operating Systems > Linux / Variants > LPD problems
LPD problems
Posted by Scott Navarre on February 3rd, 2004


Hello,

I had a spool set up on my Red Hat 8.0 machine for my HP LaserJet IID on
my Windows 98 machine. It worked fine before (just yesterday actually), but
now when I try to send something to it, it gives me an error:

# lp /etc/hosts
Status Information:
sending job 'root@linux+265' to hpwin@localhost
connecting to 'localhost', attempt 1
cannot open connection to localhost - No such file or directory
Make sure the remote host supports the LPD protocol

This is strange considering that 'hpwin' is setup as a Windows (SMB)
printer in RedHat -> System Settings -> Printing. Here is the entry I am
shown when I go there:

green check mark (shows this is the default printer)
Queue: hpwin
Queue Type: SMB
Details: //CYBERTRON/HPIID

which looks right since my Win98 machine has a network name of "Cybertron"
and a shared printer as "HPIID". I also have it set up as a text only
printer.
So why does it say its trying to use 'localhost' when I try to send it a
print job?

Next, I tried:
# service lpd restart
Stopping lpd: [FAILED]
Starting lpd: 2004-02-03-09:26:55.809 linux Read_file_list: cannot stat
required or included file '/etc/printcap' - Permission denied
2004-02-03-09:26:55.969 linux Read_file_list: cannot stat required or
included file '/etc/printcap' - Permission denied
[FAILED]

then when I checked my /etc/printcap:
# ls -l /etc/printcap
-rw-r--r-- 1 root root 795 Feb 3 01:48 /etc/printcap

And I even tried to:
# chmod 777 /etc/printcap
but now I think maybe permission is denied because lpd is failing to stop

and when I try:
# lpstat
Printer 'hpwin@localhost' - cannot open connection - No such file or
directory
Make sure the remote host supports the LPD protocol
Printer 'hpwin@localhost' - cannot open connection - No such file or
directory
Make sure the remote host supports the LPD protocol

I tried rebooting, deleting the printer and adding one with a different
queue name (it was actually 'hptext' before when I started having this
problem, instead of 'hpwin'), but it is still doing this!

What happened??? And how can I fix it?

Thanks in advance,
Scott Navarre


Posted by Scott Navarre on February 3rd, 2004


I took a close look at the startup messages, and it appears my problem isn't
limited to lpd alone -- I also see the following (in addition to the lpd
messages):

Starting sendmail: 451 4.0.0 /etc/mail/sendmail.cf: line 95: fileclass:
cannot open '/etc/mail/local-host-names': World writable directory
451 4.0.0 /etc/mail/sendmail.cf: line 571: fileclass: cannot open
'/etc/mail/trusted-users': World writable directory

but when I checked these files are there as well...


Posted by Peter Köhlmann on February 3rd, 2004


Scott Navarre wrote:

And why is it world-writeable?
--
Windows was created to keep stupid people away from UNIX."
**--*Tom*Christiansen


Posted by Bill Marcum on February 3rd, 2004


["Followup-To:" header set to alt.comp.linux.]
On Tue, 3 Feb 2004 03:00:24 -0700, Scott Navarre
<smn@asus.net> wrote:
And when did you start having these problems? Maybe you should run
chkrootkit.


--
O, it is excellent
To have a giant's strength; but it is tyrannous
To use it like a giant.
-- Shakespeare, "Measure for Measure", II, 2

Posted by Scott Navarre on February 4th, 2004


Oh yes, the /etc had "drwxrw-rw-" permisions!

I had an accident a few days ago where I mistakingly started to overwrite
my system files after doing a 'cpio' on a file that came from an old BSD
Unix system... I had forgotten to use the "--no-absolute-filename" switch.
Luckily, the file names/paths were different enough between BSD Unix and
Linux to not cause too many problems. Most of the problems were in the /bin
directory where I just copied the files back over from another of my linux
systems, and deleted the rest. I had to also manually restore permissions
and owner's of a few directories (including /etc). I must have accidentally
used a "766" instead of a "755" with my 'chmod' command.
So, setting this correctly has fixed my 'sendmail' problem at startup.

But what about 'lpd'? After the accidental overwrite (explained above), I
was able to print to my networked printer on Win98. But maybe my manual
fixing of file/directory permissions messed something up in lpd???
What could it be? It still isn't working.