Setting up CUPS with USB printer

Cary cary at sdf.org
Sun Feb 2 12:42:10 UTC 2014


Jonathan Chen wrote:
> Hi,
> 
> I've installed cups-base and have followed the instructions on the pkg-message.
> Currently the permissions appear correct:
> 
>   ~,6:50pm# ls -l /dev/unlpt0
>   crw-rw----  1 cups  cups  0x74  2 Feb 18:16 /dev/unlpt0
> 
> I have verified that the "cups" user can print to the file by:
>   # su -m cups
>   % date > /dev/unlpt0
> 
> The contents of /usr/local/etc/cups/printer.conf are:
> 
>   # Printer configuration file for CUPS v1.5.4
>   # Written by cupsd on 2014-02-02 18:47
>   # DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
>   <Printer BrotherHL-5340D>
>   UUID urn:uuid:86ecde22-e8f2-383c-6a46-5442583f76de
>   Info Brother Laser Printer
>   Location Home
>   MakeModel Brother HL-5340D BR-Script3
>   DeviceURI usb:/dev/unlpt0
>   State Idle
>   StateTime 1391319777
>   Type 8433748
>   Accepting Yes
>   Shared No
>   JobSheets none none
>   QuotaPeriod 0
>   PageLimit 0
>   KLimit 0
>   OpPolicy default
>   ErrorPolicy stop-printer
>   </Printer>
> 
> However, when I attempt to print a test-page, the Job stalls and the
> printer reports:
>   Processing - "Waiting for printer to become available."
> 
> The error logs are equally uninformative:
>   I [02/Feb/2014:18:53:07 +1300] [Job 364] Waiting for printer to
> become available.
>   D [02/Feb/2014:18:53:12 +1300] [Job 364] libusb_get_device_list=1
>   ...
> 
> What have I missed?
> 
> Cheers.
> 

Hi,

printer.conf looks all right.

Cups installs four files with names that are the same as print utilities
which are part of the FreeBSD base.

cups gives you:

/usr/local/bin/lp
/usr/local/bin/lpq
/usr/local/bin/lpr
/usr/local/bin/lprm

FreeBSD already has:

/usr/bin/lp
/usr/bin/lpq
/usr/bin/lpr
/usr/bin/lprm

If you rename the four files in /usr/bin your test page may print.

$ sudo sh
# id -u
0
# cd /usr/bin
# for a in lp*; do mv $a  bsd-${a}; done
# exit


The man pages in /usr/share/man/man1/ could also be renamed.
Cups has its man pages for those files in /usr/local/man/man1/.

If the BSD files are not renamed the files installed by cups-base are not executed
because of the order that directories are listed in the environment
variable PATH.

When you upgrade, the adjustments may have to be made all over again.  However, binary
upgrades do not seem to revert these changes (at least not in my experience.)
;-)

See the output of "ls /usr/local/bin/lp*"  and  "ls /usr/local/sbin/lp*" for more files
that the cups-base port has installed for you.

HTH,

Cary


-- 
cary at sdf.org
SDF Public Access UNIX System - http://sdf.org


------------------------------


More information about the freebsd-questions mailing list