http://forums.freesco.org

Samba and LPRng

Topic: LPRng & Samba?, Can anyone help?  
dingetje Online




Group: Moderators
Posts: 1676
Joined: Nov. 2001
Posted: Oct. 30 2002,02:12  

As a matter of fact I have just switched my HP Deskjet 840C shared printer from my Win2K to the freesco box using the LPRng and Samba packages.

I will only post the relevant sections of the smb.conf and printcap file here:

/etc/printcap
Quote

.common:
  :sd=/mnt/router/packages/lprng/spool/%P
  :sh:mx=0:mc=0
  :done_jobs=0
hp840c:tc=.common:lp=/dev/lp1


After making these changes (where hp840c is the desired queue name, and /dev/lp1 the parallel port the printer is attached too) type these commands:

[Linux] cd /mnt/router/packages/lprng/sbin
[Linux] checkpc -V -f

Sample run:
Quote

LPRng-3.8.12, Copyright 1988-2002 Patrick Powell,
Checking for configuration files '/mnt/router/packages/lprng/etc/lpd.conf'
 found '/mnt/router/packages/lprng/etc/lpd.conf', mod 0100644
Checking for printcap files '/mnt/router/packages/lprng/etc/printcap'
Checking for lpd only printcap files '/mnt/router/packages/lprng/etc/lpd_printcap'
DaemonUID 0, DaemonGID 0
Using Config file '/mnt/router/packages/lprng/etc/lpd.conf'
LPD lockfile '/var/run/lpd.515'

.names
:.common=.common
:hp840c=hp840c

.all
:hp840c

#Printcap Information
hp840c
:lp=/dev/lp1
:mc=0
:mx=0
:sd=/mnt/router/packages/lprng/spool/hp840c
:sh
Checking printcap info
Checking printer 'hp840c'
Checking directory: '/mnt/router/packages/lprng/spool/hp840c'
  directory '/mnt'
  directory '/mnt/router'
  directory '/mnt/router/packages'
  directory '/mnt/router/packages/lprng'
  directory '/mnt/router/packages/lprng/spool'
  directory '/mnt/router/packages/lprng/spool/hp840c'
 checking 'control.pr' file
 checking 'status.pr' file
 checking 'status' file
 checking 'log' file
 checking 'acct' file


This is using the verbose mode, when you ommit the -V checkpc does it's work silently (unless a real error exists).

Now test run the newly added queue by sending a test file with the lpr command. If you're at this stage you're halfway through!

smb.conf
Quote

[printers]
       path = /mnt/router/packages/samba/var/spool
       #  ---  do not use the Samba default path = /tmp
       print ok = yes
       printing = lprng
       load printers = yes
       printcap name = /etc/printcap
       guest ok = yes
       print command =       /bin/lpr  -U%U@%M -P%p -r %s    
       lpq command   =       /bin/lpq  -U%U@%M -P%p    
       lprm command  =       /bin/lprm -U%U@%M -P%p %j    
       lppause command =     /bin/lpc -U%U@%M hold %p %j    
       lpresume command =    /bin/lpc -U%U@%M release %p %j    
       queuepause command =  /bin/lpc -U%U@%M stop %p        
       queueresume command = /bin/lpc -U%U@%M start %p    


Save the changes and type rc_samba restart
Make sure the spool directory exists and is owner by root, then type:

chmod 1777 /mnt/router/packages/samba/var/spool

Next browse your network and look for the queue name on your freesco box (hp840c in the example).

Adding a queue on the windoze box is peanuts now. A test job should print.

Here are some more tips:
http://www.lprng.com/LPRng-HOWTO-Multipart/smb.htm

Note: it's also possible to have your freesco samba server provide the printer driver for various windoze platforms. How to do this is described online (use Google).

HTH

--------------
GreetZ
http://dingetje.homeip.net/
Uptime
"Software is like sex: it's better when it's free." - LINUS TORVALDS

Back to top