Solved lpr not working with FreeBSD11

Hi All

So I decided to upgrade a server that still had 9.3 and when the upgrade commands failed I just loaded 11 right over top. No big problem, my files for the NFS shares are all on separate RAIDs from the OS so everything was there when 11 came back up.

I have a book that I record all the commands I use to set up the various servers and I've got a set procedure to set up basic printing on a server without CUPS. I've used this three or four times on 9.3 and it always worked but it doesn't on 11. I'm hoping someone can point out what has changed for me.

Here's what I do:

mkdir -p /var/spool/lpd/lp
chown daemon:daemon /var/spool/lpd/lp
chmod 770 /var/spool/lpd/lp

I then edit /etc/printcap and add:

Code:
lp:\
                  :lp=\
                  :sh:\
                  :mx#0:\
                  :rm=Frankenstein:\
                  :rp=raw:\
                  :sd=/var/spool/lpd/lp:\
                  :lf=/var/log/lpd-errs:\
                  :if=/usr/local/libexec/lf2crlf:

I create the file /usr/local/libexec/lf2crlfusing vi and insert:

Code:
#!/bin/sh
CR=$'\r'
/usr/bin/sed -e "s/$/${CR}/g"

next I edit /etc/rc.conf and insert:

Code:
lpd_enable="YES"

then I check the printcap with chkprintcap
then service lpd start

Finally I put Frankenstein (my printer) into the /etc/hosts file by running:

echo "192.168.24.75 Frankenstein" >> /etc/hosts

At this point I can usually run pkg info | lpr and get a page of output but instead the printer wakes up but nothing prints. I get a mail message that says:

Your printer job
could not be printed.



I've double shecked all the steps I did and compared all the files to another working unit in the same rack. I've done a full reboot and the only difference seems to be that the server that doesn't work is FreeBSD11.

JayArr
 
LOL

Here's some more data, I looked in my lpd-errs log and saw this:

sed: 1: "s/$//r/g
": bad flag in substitute command: "r"

The thing is that the lf2crlf file says

"s/$/${CR}/g"

but it's somehow being interpreted as:

"s/$//r/g"

Anyone have any ideas why the ${CR} is being turned into /r

??

JayArr
 
Found my error.

It was a typo.

The above instructions work to get basic output from the server. (I'm using a Xerox printer/copier WCP232)
 
Thank you. That will probably help someone in the future. (Not necessarily an identical typo, but getting an idea of where to look.)
 
Last edited by a moderator:
Back
Top