I have a Samba server which users LPRng 3.8.19 as released with Redhat 9. The server does not do any actual printing but forwards the print jobs to one of 2 print servers depending upon whether the printer to be used is accounted or not. My problem is that I need the server that deals with accounted printers to know the name/IP address of the PC that generated the print job rather than the name of the samba server that issued the lpr command i.e. override the value of the 'H' line in the control file with the %M samba value. Can this be done and, is so, then how?
Thanks to Christof Beyer and Rick Cochran for their help. I agree with Qiang that it would be useful to have something included in the HOWTO.
I ran into the following problems/features.
1) The following is my printcap entry as reported by lpc:-
lpc printcap isstaff1 Printer: [EMAIL PROTECTED] isstaff1 :control_filter=/usr/local/sbin/cfilter :lf=/var/spool/printers/%P/log :rm=praccserv.kis.keele.ac.uk :rp=%P :sd=/var/spool/printers/%P
The jobs are spooled locally and then forwarded to praccserv. I found that the control filter was actually run twice; the first time when the job was spooled locally and again when the job was transferred to praccserv. I got around this but had expected LPRng to be clever enough to realise that one would only want to filter the job file once!
2) LPRng does not handle the job class correctly. Once lpr has made an initial decision as to the class of a job (either by default or from the -C parameter on the lpr command) it ignores whatever value may be set in the control file. (I think it uses the third character of the control file name). This behaviour persists even if the job is transferred to another spooler running LPRng. If the job is transferred to a system running a different implementation of lpd (eg a lpd emulator on a printer) the class is correctly taken from the contents of the control file. For example, my samba server (wins3.kis.keele.ac.uk) would execute the print command something like
lpr -Pisstaff1 -Cderek.isc.keele.ac.uk -r smbprn.003713.QtExO
The job was appeared on the queue as
lpq -Pisstaff1
Printer: [EMAIL PROTECTED] (dest [EMAIL PROTECTED])
Queue: 1 printable job
Server: no server active
Status: isstaff1: Check_for_missing files: SUCCESS 'cfD379derek.isc.keele.ac.uk' at 14:21:41.145
Rank Owner/ID Class Job Files Size Time
1 [EMAIL PROTECTED] D 379 smbprn.003713.QtExOK 61491 14:21:41
done [EMAIL PROTECTED] D 616 smbprn.003709.H0njIT 61491 14:08:23
Printer: [EMAIL PROTECTED] (originally isstaff1) (dest [EMAIL PROTECTED]) 'IS staff printer' (printing disabled) (bounce to [EMAIL PROTECTED])
Queue: no printable jobs in queue
Status: server finished at 14:10:59
JetDirect lpd: no jobs queued on this port
Note that the control file name starts cfD and its contents were
cat cfD379derek.isc.keele.ac.uk [EMAIL PROTECTED] CA D2004-01-08-14:21:41.095 Hderek.isc.keele.ac.uk Jsmbprn.003713.QtExOK Lcca15 Pcca15 Qisstaff1 Nsmbprn.003713.QtExOK fdfA379derek.isc.keele.ac.uk UdfA379derek.isc.keele.ac.uk
Also note that my filter only modified the class and host (C and H) lines. Strangely enough the f and U lines have been remade by lprng but not the A line. You will note that the class is set to A but lpq has reported it as D (the capitalised first letter of the -C parameter on the lpr command.
After being transferred to the print server (which is a bsdi machine running LPRng version 3.5.3) the spool file has the same name and contents and lpq still reports the class incorrectly.
lpq -Pisstaff1
Printer: [EMAIL PROTECTED] (dest [EMAIL PROTECTED]) 'IS staff printer' (printing disabled) (bounce to [EMAIL PROTECTED])
Queue: 2 printable jobs
Server: no server active
Status: server finished at 14:10:59
Rank Owner/ID Class Job Files Size Time
1 [EMAIL PROTECTED] J 497 smbprn.003714.A8BoN 53310 14:15:54
2 [EMAIL PROTECTED] D 379 smbprn.003713.QtExO 61491 14:15:58
JetDirect lpd: no jobs queued on this port
However, the printer printed as standard HP banner page giving the class correctly as A.
-- Derek _________________________________________________________________ Dr. D. Wanless Tel: +44 (0)1782 583071 Computing Services Fax: +44 (0)1782 584234 Keele University Email: [EMAIL PROTECTED] Keele,Staffs. ST5 5BG
----------------------------------------------------------------------------- YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests or lprng-digest-requests) with the word 'help' in the body. For the impatient, to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED] with: | example: subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED] unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word LPRNGLIST in the SUBJECT line. -----------------------------------------------------------------------------
