Solved

Printing on Linux (remote printing)

Posted on 1998-06-14
13
332 Views
Last Modified: 2013-12-15
I have three Linux boxes at my place of work that we are trying to get setup to print. One as the print server and the other two to access that print server.  

I have edited the /etc/printcap file and it looks like this:
##PRINTTOOL3## REMOTE bj200 180x360 letter {} CanonBJ200 Default 1
lp:\
    :sd=/var/spool/lpd/lp:\
    :mx#0:\
    :sh:\
    :rm=lunar:\
    :rp=/var/spool/lpd/lp:\
    :if=/var/spool/lpd/lp/filter:

and entered the appropriate entries in the hosts.lpd file on the print server.  I restart the lpd and try to test a printout to the server and I receive an error -- Connection to lunar down:  ( I notice then that I had not restart the lpd on the server - redid that ).  Now the error I am receiving is [ lunar: lpd: /var/spool/lpd/lp: unknown printer ]  -- What is wrong and can someone please help me out on this situation.
0
Comment
Question by:bryanjones
  • 6
  • 4
  • 2
  • +1
13 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
The posted printcap is from your client, right?
Then you must change the :rp entry to point to the print queue you have specified on the remote print server (see lunar's printcap), for example it should read:

    :rp=bj200:\

You also can remove  :if  'cause filtering will be done on the server.
0
 
LVL 1

Author Comment

by:bryanjones
Comment Utility
This is the printcap file from lunar:

lp:\
     :sd=/var/spool/lpd/lp:\
     :mx#0:\
     :sh:\
     :lp=/dev/lp1:\
     :if=/var/spool/lpd/lp/filter:

So the rp should be equal to what it is set to right now -- and as far as the filtering it should not matter if it is there or not -- I have tried with it both ways and still the same error:

lunar: lpd:  /var/spool/lpd/lp: unknown printer
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
lunar's printcap sound good, but on the clients you then should have:

    :rp:lp:\
0
 
LVL 1

Expert Comment

by:t2pp
Comment Utility
bryanjones - here's an example for you; easily adaptable to your situation. Simply modify the device & filenames as appropiate. Also, you might like to leave a blank in between the ":" and the "\", as this can cause problems. Good luck.
 
On the Server:
# HP DeskJet 550 (Postscript)
psjet550|postscript_inkjet: \
        :lp=/dev/lp1: \
        :sd=/var/spool/lpd/psjet550: \
        :if=/usr/local/bin/psjetfilter550: \
        :mx#0: \
        :sh:

On the Client:
# HP DeskJet 550 (Postscript)
psjet550|postscript_remote_____________bluechip: \
        :lp=/dev/null: \
        :sd=/var/spool/lpd/psjet550: \
        :rm=bluechip: \
        :rp=psjet550: \
        :mx#0: \
        :sh

0
 
LVL 1

Author Comment

by:bryanjones
Comment Utility
Well now I do not receive the error but the printouts are going to the printer -- the command that I use is lpr filename and then I do a check in /var/log/messages and it states that  [ eclipse requests printjob lp ] and then nothing goes to the que nor to the printer.  Why is this and what am I doing wrong.  It seems like the lunar does not get the files to send or nothing ques up.
0
 
LVL 1

Author Comment

by:bryanjones
Comment Utility
Well now I do not receive the error but the printouts are going to the printer -- the command that I use is lpr filename and then I do a check in /var/log/messages and it states that  [ eclipse requests printjob lp ] and then nothing goes to the que nor to the printer.  Why is this and what am I doing wrong.  It seems like the lunar does not get the files to send or nothing ques up.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:bryanjones
Comment Utility
When I print something from the eclipse machine I notice that the /var/spool/lpd/lpd.lock file gets a lock pid from startup and then when eclipse ques something up it gets placed in the lpd.lock file allso ie....cfA071eclipse ( correct if I am wrong but this seems to be the que format of a printout but nothing gets qued onto lunar.)
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
have you exported lunar's /var/spool/lpd ?
0
 
LVL 4

Expert Comment

by:jlms
Comment Utility
Is you lpd daemon running? Can you print in the machine that has the printer attached?

The sintaxis in the printcap file is very strict and tricky, check the next:

that there are not spaces after the \ at the end of each line.
That the last line finishes with:
That the first character of each line is a tab.

Now, in your clients you NEED the line that says:
      rp=lp:\

rp stands for Remote Printer and it is the name that the printer has in the system that has it physicaly (parallel or serial cable) attached.

  Use the command lpc to check for the status of the queue in both the printer server and the client, this could give you some clues about the problem.

  Check also the permissions and ownership of the directory
/var/spool/lpd/lp
it should be owned by the user "lp" and to make sure it works you can give it permissions 777.

   About the filter, it certainly matters, what about if it routes your output to the /dev/null device? So have a look at it to see if you need it or not. For testing porpouses is better if you delete it and send only text files. Once you get this working then you can concentrate in the working of the filter.
0
 
LVL 1

Author Comment

by:bryanjones
Comment Utility
I have the syntax correct thanks to t2pp - and yes the lpd is running and I am able to print.  My problem is that the remote machines are queing up but not sending to print que to the server.

Once again I am not able to send the ques to the print server.
0
 
LVL 1

Accepted Solution

by:
t2pp earned 310 total points
Comment Utility
A couple of things...  1) can all these boxes ping each other - assuming you're IP?  2) If so, can you ping by name rather that IP address? This will verify that /etc/hosts is ok.  3) Please check that hosts.lpd on the server has all the client's names.  4) As for the daemon, issue *lpc status* command on the server and client to see were it's stuck. and finally 5) check /var/log/messages and /var/log/syslog for any clues.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
Again, have you exported your sppol dir on lunar?
0
 
LVL 1

Author Comment

by:bryanjones
Comment Utility
t2pp -- the last response you gave me about the printcap file worked -- I just had lp as the printer name and it would not work then -- after I assigned it a name it was fine.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now