> From [EMAIL PROTECTED] Fri Oct 4 14:05:51 2002
> From: "David Mathog" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: netatalk ifhp questions (two)
> Date: Fri, 04 Oct 2002 14:05:50 -0700
>
> I've been trying to get ifhp/lrpng to go through netatlk to some
> printers. It works, but it required a kludge which I don't
> understand.
>
> Here's the printcap entry:
>
> testc1:\
> :ml=0:\
> :mx=0:\
> :sd=/var/spool/lpd/testc1:\
> :af=/var/spool/lpd/testc1//testc1.acct:\
> :sh:\
> :lp=| /tmp/papbackend \
> :lpd_bounce=true:\
> :ifhp=model=ps,status@ \
> :filter=/usr/libexec/filters/ifhp
>
>
> here's papbackend
>
> #!/bin/sh
> #
> # Usage: papbackend job user title copies options [filename]
> #
> # eat first line, a spurious %!
> head -1 >/dev/null
> #
> # send the rest to the printer
> #
> /usr/local/bin/pap -e -p "`cat .paprc`"
> exit 0
>
> 1. This works but it leaves one "ifhpxxxxxx" file in the
> /var/spool/lpd/testc1 directory for each file printed. This
> file isn't removed when the rest of the job is with an
>
> lprm -Ptestc1 job#.
>
> It also isn't passed as a parameter to papbackend. So
> what is supposed to clean these files out?
>
> 2. Where is the spurious first "%!" line coming from?
> It isn't in the "ifhpxxxxxx" file If it wasn't there I
> could skp the whole papbackend script and just put pap
> in the printcap entry.
>
> Versions:
> ifhp-3.5.10-1
> LPRng-3.8.15-1
> netatalk 1.5.5
>
> I didn't do anything but install ifhp. The ultimate list
> of printer targets is mixed but all support postscript. Many
> do not support PCL/PJL.
>
> Thanks,
>
> David Mathog
> [EMAIL PROTECTED]
> Manager, Sequence Analysis Facility, Biology Division, Caltech
>
Take a look in the LPRng/UTILS/atalkprint file - this is
the singing/dancing/standup comedy version of your file.
This appears to work - it even has documentation. Here is
a copy:
#!/bin/sh
# This is a template file for hooking up printing to a remote
# printer that needs a communication program
#
# Modified by Patrick Powell <[EMAIL PROTECTED]> for the LPRngTool
# Note 1: the .config file is assumed to be in the current directory
# Note 2: entries can be in any order in the file
#
# This script is an input filter for printcap printing on a unix machine. It
# uses the smbclient program to print the file to the specified smb-based
# server and service.
# For example you could have a printcap entry like this
#
# atalk:lp=/dev/null:sd=/usr/spool/lpd/atalk:if=/usr/local/filters/atalkprint
# :lprngtooloptions=authfile=.auth
#
# which would create a unix printer called "atalk" that will print via this
# script.
#
# The script gets its information from the .config file in the
# printer spool directory
# You can get the configuration values from the printcap 'smb_options' line
# host=host host for printing
# printer=printer printer
# share=//host/share for SMB printing
# hostip=whatever for SMB printing
# auth=authfile for username and password
# example: :smb_options= host="host" printer="lp"
#
# Should read the following variables set in the auth file:
# username=username for authentication
# password=password for authentication
if [ -f ./general.cfg ] ; then
. ./general.cfg
fi
options=`echo "${PRINTCAP_ENTRY}" | sed -n 's/:atalk_options=//p' `
if [ -n "$options" ] ; then
eval export $options
fi
# do this if you need to set the value in shell variables
if [ -n "$authfile" -a -f "$authfile" ] ; then
. ${authfile}
fi
# now you simply use the paramters you have to extract the options and
# put them on the command line.
#
# here is an example for SMB printing using smbprint
# smbclient "$share" -E ${hostip:+-I} $hostip -N ${workgroup:+-W} "$workgroup" \
# ${authfile:+-A} "$authfile" -c "$command" 2>/dev/null
# We modify this a bit and use PAP from the netatalk package
/usr/bin/pap -p "$username:$printer@$host"
-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------