Solved

Printing on Linux (remote printing)

Posted on 1998-06-14
13
338 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
ID: 1627802
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
ID: 1627803
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
ID: 1627804
lunar's printcap sound good, but on the clients you then should have:

    :rp:lp:\
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 1

Expert Comment

by:t2pp
ID: 1627805
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
ID: 1627806
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
ID: 1627807
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
ID: 1627808
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
ID: 1627809
have you exported lunar's /var/spool/lpd ?
0
 
LVL 4

Expert Comment

by:jlms
ID: 1627810
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
ID: 1627811
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
ID: 1627812
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
ID: 1627813
Again, have you exported your sppol dir on lunar?
0
 
LVL 1

Author Comment

by:bryanjones
ID: 1627814
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

839 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