[vox-tech] CUPS on FreeBSD

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Wed Oct 12 19:32:48 PDT 2005


Jeffrey J. Nonken wrote:
> One question before we start... should I or should I not be running 
> lpd while trying to use CUPS? I've got conflicting and unclear 
> information on that. Is CUPS supposed to be handling all of it, or 
> does it need a spooler?

CUPS emulates lpd.  The instructions you said you had followed
pointed out that you would have to mv the lpd commands in /usr/bin
so that the CUPS equivalents from /usr/local/bin would get invoked
instead from later in the PATH.

> On Wed, 12 Oct 2005 08:57:23 -0700, Jeff Newmiller wrote:
> 
>>Jeffrey J. Nonken wrote:
>>
>>>On Mon, 10 Oct 2005 10:01:31 -0700, Jeff Newmiller wrote:
>>>
>>
>>[...]
>>
>>
>>>>In my case, verifying that the UID that the filters run under
>>>>(listed in cupsd.conf) have appropriate permissions was the
>>>>most challenging thing to get working right.  The CUPS daemon
>>>>runs as root, but runs actual print jobs as a lower-privilege
>>>>user.
>>>>
>>>
>>>I've spent two days on this and I've gotten almost nowhere. If
>>>the next part is the _challenging_ bit, maybe I should throw in
>>>the towel now.
>>>
>>
>>Sorry, I couldn't help but laugh at that. :-/ 
> 
> 
> No, that's good. Laughing is good.
> 
>>>However, I have set filters permissions according to
>>>instructions, FWIW. Whether that's an issue remains to be seen. 
>>
>>Ah, but have you verified that the appropriate users have
>>permissions they need?  I don't know how FreeBSD handles USB, but
>>the UID that CUPS runs under has to be able to access the device,
> 
> 
> I'm still feeling my way around this, but I think this means CUPS 
> itself is running as root:
> 
>   UID   PID  PPID CPU PRI NI   VSZ  RSS MWCHAN STAT  TT       TIME 
> COMMAND
>     0   417     1   0  96  0  4944 3396 select Ss    ??    0:00.17 
> /usr/local/s

Yes, cupsys runs as root... but the cupsd.conf file tells it what
username to run filters as to minimize security exposure.  That user
is who has to have privileges set properly.

> -bash-2.05b$ ls -l /dev/ulpt0
> crw-r--r--  1 root  operator  241,   0 Oct 12 10:37 /dev/ulpt0

So you have to make sure that the UID that the CUPS filters run
under is a member of the "operator" group.

I have been assuming you read my CUPS post from recent archives...
http://www.mail-archive.com/vox-tech@lists.lugod.org/msg11029.html
though that was perhaps not a good assumption.

> I'm not sure that this is relevant (yet) since the problem of CUPS not 
> respond happened _before_ I tried adding a printer. The printer device 
> not being accessible can't possibly affect my ability to to connect to 
> CUPS ex-post-facto.

It can affect connections if cupsys refuses to run due to permissions
problems.

> I have done one thing since my last message: I went into client.conf 
> and explicitly added the local hostname as ServerName, and did the 
> same to cupsd.conf, even though the comments claim it uses that name 
> by default. Once I added it to client.conf I was able to connect 
> implicitly to cups via lpstat and lpadmin, so I assume I did something 
> right.

I suppose... though I am using the default setting for that.

> aphrodite# lpstat -a
> 5850 accepting requests since Jan 01 00:00
> HPLJ5850 accepting requests since Jan 01 00:00
> aphrodite# lpstat -s
> system default destination: 5850
> device for 5850: usb:/dev/ulpt0
> device for HPLJ5850: socket://192.168.0.52

The HPLJ5850 seems wrong... going to a socket on your own ip address is
a circle with no end.  That is what you do to print to devices attached
to another host.

> However, I still can't see anything in the Device pulldown menu when I 
> try to add a printer via the web interface, nor can I see the two 
> printers I've added via lpadmin. And I can't seem to do anything like 
> actually printing. So there's still mischief afoot. But it is a step 
> forward.
> 
> 
>>as well as the printer directories in  /var. (Kubuntu moved the
>>default conf file from the CUPS-recommended directory structure
>>into the /etc to conform with Debian standards, but that mostly
>>changed how I dealt with multiple types of printers.)
>>
>>Anyway, you didn't make your conf file available, so I haven't been
>>able to offer any help with that.
>>
>>One other thing... if you are trying to use a printer you added
>>before you stabilized your cupsd.conf file, you might want to try
>>deleting that one and adding it again.
> 
> 
> I haven't really stabilized it, mostly I looked through it and decided 
> that the defaults would work. I was going to follow your earlier 
> advice and go through it line by line, I just haven't had an 
> opportunity yet. I think I'll do that before I toss it in your 
> direction. Get all the simple stupid stuff out of the way and take 
> care of anything you couldn't possibly know without examining my 
> system -- like conflicts between default and actual directories. I 
> believe that FreeBSD also moved some things to conform to its own 
> standards.
> 
> I would expect a properly ported utility to have that done, but that 
> doesn't mean it's so. So I will kick those assumptions out and take 
> care of that before asking more stupid questions.

I am only slightly ahead of you... such that I am not sure which
of your questions might have been stupid.  I was certainly not expecting
to have to get as deep into CUPS as I had to, given its friendly face.

-- 
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                       Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------


More information about the vox-tech mailing list