[Samba] printcap file

zefiro zefiro at eosconsulting.org
Tue Sep 3 15:53:09 GMT 2002


Suse Ver. 7.3 profesional

Samba Ver. 2.2.1a 

Windows PC printer

 

Setting smbprint_LS filter in the /etc/printcap file, to print on a printer connected to Windows PC (which is ok on other Linux Slackware and RADHAT versions), no sistem error is generated but the printer don't  works and we receive, in /var/mail/root,  the following mail: 

 

subserver pid 5687 starting at 2002-06-24-12:20:16.655 ## A=root at mirror+685 number=685 process=5687
accounting at start at 2002-06-24-12:20:16.671 ## A=root at mirror+685 number=685 process=5687
waiting for subserver to exit at 2002-06-24-12:20:16.672 ## A=<NULL> number=0 process=5686
opening device '/dev/null' at 2002-06-24-12:20:16.695 ## A=root at mirror+685 number=685 process=5687
printing job 'root at mirror+685' at 2002-06-24-12:20:16.695 ## A=root at mirror+685 number=685 process=5687
processing 'dfA685mirror.eos', size 513, format 'l', IF filter 'smbprint_LS' at 2002-06-24-12:20:16.695 ## A=root at mirror+685 number=685 process=5687
IF filter 'smbprint_LS' filter msg - 'Make_passthrough: pid 5688, execve '/usr/bin/smbprint_LS' failed - 'Exec format error'' at 2002-06-24-12:20:16.700 ## A=root at mirror+685 number=685 process=5687
IF filter 'smbprint_LS' filter exit status 'JABORT' at 2002-06-24-12:20:16.700 ## A=root at mirror+685 number=685 process=5687
printing finished at 2002-06-24-12:20:16.700 ## A=root at mirror+685 number=685 process=5687
accounting at end at 2002-06-24-12:20:16.700 ## A=root at mirror+685 number=685 process=5687
finished 'root at mirror+685', status 'JABORT' at 2002-06-24-12:20:16.700 ## A=root at mirror+685 number=685 process=5687
subserver pid 5687 exit status 'JABORT' at 2002-06-24-12:20:16.702 ## A=<NULL> number=0 process=5686
job 'cfA685mirror.eos' error 'aborting operations' at 2002-06-24-12:20:16.714 ## A=<NULL> number=685 process=5686
sending mail to 'root' at 2002-06-24-12:20:16.714 ## A=<NULL> number=685 process=5686

 

printcap file

 

#

# This printcap is being created with printtool v.3.41

# Any changes made here manually will be lost if printtool

# is run later on.

# The presence of this header means that no printcap

# existed when printtool was run.

#

lp:lp=/dev/lp0:sd=/var/spool/lpd:sh

LP:lp=/dev/lp0:sd=/var/spool/lpd:sh

#

LS:lp=/dev/null:sd=/var/spool/samba:sh:sf:if=/usr/bin/smbprint_LS

 

smbprint_LS filter file

 

logfile=/tmp/smb-print.log

(

# NOTE You may wish to add the line `echo translate' if you want automatic

# CR/LF translation when printing.

echo translate

echo "print -"

cat

) | /usr/bin/smbclient "//paghe/HP1200" "" -U "paghe" -N >> $logfile

#end of /usr/local/samba/bin/smbprint

 

 

If smbprint_LS1 is used, with same parameters, as filter of echo or cat statments, it is correct and the print is ok.

 

Example:

              echo -en "\rHELLO\r\f" | /usr/bin/smbprint_LS1                  print ok!

              cat file | /usr/bin/smbprint_LS1                                        print ok!  

 

 

smbprint_LS1 filter file

 

logfile=/tmp/smb-print.log

/usr/bin/smbclient "//paghe/HP1200" "" -c "print -" -U "paghe" -N >> $logfile

#end of /usr/local/samba/bin/smbprint

 

 

Installing the printer with YAST2 as Samba Printer, with the same parameters used in the filter, the printer works if we use LS and and LS-ascii, but there are no possibility to send different character sequences, because these sequences are not recognized (but the sequence is correct!).

 

If we use LS-raw the printer don't work and we obtain the same result as we use our filter smbprint-LS.

 

 

printcap file generated from YAST2

 

### BEGIN apsfilter: ### /etc/gs.upp/y2prn_LS.upp LS ###

# Warning: Configured for apsfilter, do not edit the labels!

# apsfilter setup Tue Jun 25 19:33:11 CEST 2002

#

LS-ascii|lp1|y2prn_LS.upp--ascii-LS|y2prn_LS.upp ascii:\

:lp=/dev/null:\

:sd=/var/spool/lpd/y2prn_LS.upp--ascii-LS:\

:lf=/var/spool/lpd/y2prn_LS.upp--ascii-LS/log:\

:af=/var/spool/lpd/y2prn_LS.upp--ascii-LS/acct:\

:if=/var/lib/apsfilter/bin/y2prn_LS.upp--ascii-LS:\

:la@:mx#0:\

:tr=:cl:sh:

#

LS|lp2|y2prn_LS.upp--auto-LS|y2prn_LS.upp auto:\

:lp=/dev/null:\

:sd=/var/spool/lpd/y2prn_LS.upp--auto-LS:\

:lf=/var/spool/lpd/y2prn_LS.upp--auto-LS/log:\

:af=/var/spool/lpd/y2prn_LS.upp--auto-LS/acct:\

:if=/var/lib/apsfilter/bin/y2prn_LS.upp--auto-LS:\

:la@:mx#0:\

:tr=:cl:sh:

#

LS-raw|lp3|y2prn_LS.upp--raw-LS|y2prn_LS.upp raw:\

:lp=/dev/null:\

:sd=/var/spool/lpd/y2prn_LS.upp--raw-LS:\

:lf=/var/spool/lpd/y2prn_LS.upp--raw-LS/log:\

:af=/var/spool/lpd/y2prn_LS.upp--raw-LS/acct:\

:if=/var/lib/apsfilter/bin/y2prn_LS.upp--raw-LS:\

:la@:mx#0:\

:tr=:cl:sh:

#

### END apsfilter: ### /etc/gs.upp/y2prn_LS.upp LS ### 

 

Pls let us know how I can resolve this problem, it's very urgent.

Thank your for your collaboration and best regards.

 

Chiara Galbusera 

c/o Eos Consulting Srl

tel. +39 010 2461379
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the samba mailing list