Re: Cups and printer conundrums

Hello All, Some further testing, had access to a Windows Notebook, installed Canon LBP-5050N printer with USB then network connections and printed test page successfully each time, so know that cables and printer work, so back to permissions and the like with CUPS and the printer drivers, and possibly network protocols. The Windows test page does declare the data format as raw. I think there is a bit of software that will log file access. Then I can see what is called and invoked when I try to print. Then I can see what the permissions are, and a better idea of what to look for in the configurations. There were comments about Arch having a blog with useful comments. It specified commands for systemd components that I could not find under Debian. I would appreciate some pointers to stopping services, and restarting. There are files that if I am to edit, I need to stop CUPS for the duration, then restart to test. I also wish to file a form of bug report on CUPS in Debian, that I found it necessary to add myself to the appropriate groups to be able to add a printer. I would expect that the initial install where I set myself as administrator would do that. I can cope with the command line, when I have an idea of what is happening, but how about the Windows refugee who is refused access to installing any printer. We can help if they ask rather than going back to Microsoft, but they are all too likely to just reload Windows. Regards, Mark Trickett

On Fri, 12 Jun 2015 07:59:01 PM Mark Trickett wrote:
There were comments about Arch having a blog with useful comments. It specified commands for systemd components that I could not find under Debian. I would appreciate some pointers to stopping services, and restarting. There are files that if I am to edit, I need to stop CUPS for the duration, then restart to test.
Yeah, your version of Debian is too old to have systemd as the default and unfortunately I don't have a Debian box with cups running, but I'm guessing it will be something like: /etc/init.d/cups stop Do the editing you need, then: /etc/init.d/cups start Best of luck! Chris -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC

Hello Chris On Sat, 2015-06-13 at 11:49 +1000, Chris Samuel wrote:
On Fri, 12 Jun 2015 07:59:01 PM Mark Trickett wrote:
There were comments about Arch having a blog with useful comments. It specified commands for systemd components that I could not find under Debian. I would appreciate some pointers to stopping services, and restarting. There are files that if I am to edit, I need to stop CUPS for the duration, then restart to test.
Yeah, your version of Debian is too old to have systemd as the default and unfortunately I don't have a Debian box with cups running, but I'm guessing it will be something like:
7.8 is reasonably current, and when I look through the system directories, I see systemd. I will be looking closely at Devuan.
/etc/init.d/cups stop
Do the editing you need, then:
/etc/init.d/cups start
That is what I was expecting with the traditional init, but seeing the systemd bootprint, I am being careful. I have just picked up some Linux magazines, and found one tool I was looking for, "lsof" and will be carefully reading up the man pages. I have also found other reference to needing to add the lpadmin group to whichever user is trying to administer CUPS. That not being default is the wrong way round in my opinion, especially with the way that there is no pointer to the problem or solution when running up against not being able to install a printer. When I find my way around, I shall comment. I know of at least one other case where someone has succeeded, with an earlier release of the CAPT driver, on a netbook. There are two elements that changed, along with a different distro. I am still trying to get my head around the chain of workflow in CUPS, and where the bits are configured. There is a lot of good documentation, but I can see a need for slightly above raw novice primerson some of the networking and how CUPS actually works.
Best of luck! Chris
Regards, Mark Trickett

On Sat, 13 Jun 2015 08:00:14 PM Mark Trickett wrote:
Hello Chris
Hiya Mark,
On Sat, 2015-06-13 at 11:49 +1000, Chris Samuel wrote:
Yeah, your version of Debian is too old to have systemd as the default and unfortunately I don't have a Debian box with cups running, but I'm guessing it will be something like:
7.8 is reasonably current, and when I look through the system directories, I see systemd.
Wheezy (7.8) is too old for systemd to be the default, it's the default for Debian 8.0 (Jessie), I forgot to put the version numbers in, sorry.
I will be looking closely at Devuan.
I'm not running a Debian new enough for systemd, but under Ubuntu it's only made things better. Before I would get random (but often) times when my system wouldn't boot because of weird race conditions between software raid, LVM and init trying to fsck volumes before they were ready and so aborting saying it couldn't fsck something that didn't exist. Of course when I tried manually it would work. :-( That problem has gone away since going to 15.04 and systemd so I, for one, welcome our new systemd overlords. :-)
/etc/init.d/cups stop
Do the editing you need, then:
/etc/init.d/cups start
That is what I was expecting with the traditional init, but seeing the systemd bootprint, I am being careful.
I think some packages provide systemd files by default, but that doesn't mean you're running systemd. To see if you are what does "systemctl" say?
I have just picked up some Linux magazines, and found one tool I was looking for, "lsof" and will be carefully reading up the man pages.
lsof will list open files and sockets. If you just want to look for open TCP connections then you can do (as root): netstat -ntp Just drop the -n option if you want to see symbolic names for hosts and services: netstat -tp
I have also found other reference to needing to add the lpadmin group to whichever user is trying to administer CUPS. That not being default is the wrong way round in my opinion, especially with the way that there is no pointer to the problem or solution when running up against not being able to install a printer.
The Debian docs for printing say to do that if you get a permissions error: https://wiki.debian.org/SystemPrinting so perhaps there are situation where that's not neccessary? I'm not sure as Ubuntu does that by default.
When I find my way around, I shall comment. I know of at least one other case where someone has succeeded, with an earlier release of the CAPT driver, on a netbook. There are two elements that changed, along with a different distro. I am still trying to get my head around the chain of workflow in CUPS, and where the bits are configured. There is a lot of good documentation, but I can see a need for slightly above raw novice primerson some of the networking and how CUPS actually works.
In addition to the Debian CUPS page the Arch Linux wiki also has some more detailed documentation on setting up CUPS: https://wiki.archlinux.org/index.php/CUPS Best of luck! Chris -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC

Hello Chris, On Sun, 2015-06-14 at 11:11 +1000, Chris Samuel wrote:
On Sat, 13 Jun 2015 08:00:14 PM Mark Trickett wrote:
Hello Chris
Hiya Mark,
On Sat, 2015-06-13 at 11:49 +1000, Chris Samuel wrote:
Yeah, your version of Debian is too old to have systemd as the default and unfortunately I don't have a Debian box with cups running, but I'm guessing it will be something like:
7.8 is reasonably current, and when I look through the system directories, I see systemd.
Wheezy (7.8) is too old for systemd to be the default, it's the default for Debian 8.0 (Jessie), I forgot to put the version numbers in, sorry.
Certainly bits and pieces, will have to take a closer look.
I will be looking closely at Devuan.
I'm not running a Debian new enough for systemd, but under Ubuntu it's only made things better. Before I would get random (but often) times when my system wouldn't boot because of weird race conditions between software raid, LVM and init trying to fsck volumes before they were ready and so aborting saying it couldn't fsck something that didn't exist. Of course when I tried manually it would work. :-(
That problem has gone away since going to 15.04 and systemd so I, for one, welcome our new systemd overlords. :-)
systemd has some excellent promises, but I do not want the one monolithic item that has too much under its purview. There are problems with the old style init, and it can get quite complicated, but it is documented and stable, or very largely so. I do not leave my PC's running for more than the hours to do things, but I do not find the boot times unreasonable even without systemd.
/etc/init.d/cups stop
Do the editing you need, then:
/etc/init.d/cups start
That is what I was expecting with the traditional init, but seeing the systemd bootprint, I am being careful.
I think some packages provide systemd files by default, but that doesn't mean you're running systemd. To see if you are what does "systemctl" say?
Will be looking.
I have just picked up some Linux magazines, and found one tool I was looking for, "lsof" and will be carefully reading up the man pages.
lsof will list open files and sockets. If you just want to look for open TCP connections then you can do (as root):
netstat -ntp
Just drop the -n option if you want to see symbolic names for hosts and services:
netstat -tp
With the error message about a broken pipe, I suspect I will be looking for a handoff failure within the CUPS chain of processes.
I have also found other reference to needing to add the lpadmin group to whichever user is trying to administer CUPS. That not being default is the wrong way round in my opinion, especially with the way that there is no pointer to the problem or solution when running up against not being able to install a printer.
The Debian docs for printing say to do that if you get a permissions error:
https://wiki.debian.org/SystemPrinting
so perhaps there are situation where that's not neccessary? I'm not sure as Ubuntu does that by default.
Certainly it should be a default to make things less confusing for newbies. As I commented, I was able to put things together and go hunting around and find the requirement for myself, but I did a course in Unix while using CP/M before being introduced to DOS.
When I find my way around, I shall comment. I know of at least one other case where someone has succeeded, with an earlier release of the CAPT driver, on a netbook. There are two elements that changed, along with a different distro. I am still trying to get my head around the chain of workflow in CUPS, and where the bits are configured. There is a lot of good documentation, but I can see a need for slightly above raw novice primerson some of the networking and how CUPS actually works.
In addition to the Debian CUPS page the Arch Linux wiki also has some more detailed documentation on setting up CUPS:
CUPS is installed, apparently successfully, and the drivers also installed, and I can select the appropriate printer that has been detected, just the broken pipe for the network connection, and sits there saying writing data to printer or some such for USB. Since I suspect the broken pipe is all in the CUPS process on the one PC, then lsof would appear to be an appropriate tool.
Best of luck! Chris
Going to need, lost too much of today to broken back window on the VW Transporter I drive, something flung when trying to get into clearing with the brushcutter. Have taken out the majority of the glass, left the glued edge for the moment and taped a large piece of bubble wrap over the open hole to keep out the exhaust fumes and worst of the weather. Regards, Mark Trickett

On Sun, 14 Jun 2015 11:11:32 AM Chris Samuel wrote:
Wheezy (7.8) is too old for systemd to be the default, it's the default for Debian 8.0 (Jessie), I forgot to put the version numbers in, sorry.
I will be looking closely at Devuan.
I'm not running a Debian new enough for systemd, but under Ubuntu it's only made things better. Before I would get random (but often) times when my system wouldn't boot because of weird race conditions between software raid, LVM and init trying to fsck volumes before they were ready and so aborting saying it couldn't fsck something that didn't exist. Of course when I tried manually it would work. :-(
Systemd is available in wheezy and worked well in all my tests. The upgrade process from wheezy with systemd to jessie required a manual restart of systemd during the upgrade process but apart from that it was all fine. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

Hello Russell, On Mon, 2015-06-15 at 10:19 +1000, Russell Coker wrote:
On Sun, 14 Jun 2015 11:11:32 AM Chris Samuel wrote:
Wheezy (7.8) is too old for systemd to be the default, it's the default for Debian 8.0 (Jessie), I forgot to put the version numbers in, sorry.
I will be looking closely at Devuan.
I'm not running a Debian new enough for systemd, but under Ubuntu it's only made things better. Before I would get random (but often) times when my system wouldn't boot because of weird race conditions between software raid, LVM and init trying to fsck volumes before they were ready and so aborting saying it couldn't fsck something that didn't exist. Of course when I tried manually it would work. :-(
Systemd is available in wheezy and worked well in all my tests. The upgrade process from wheezy with systemd to jessie required a manual restart of systemd during the upgrade process but apart from that it was all fine.
Query on CUPS and printer drivers/filters, do you have a system user in your passwd file of lp? Who is the owner of the CUPS files, and who is the owner of the various filters/drivers? On my Debian 7.8 system, they are all owned by "root" and there is a comment in one CUPS file that at least some of them must not have the owner resolve to root. Regards, Mark Trickett

On Tue, 16 Jun 2015 06:54:44 PM Mark Trickett wrote:
Query on CUPS and printer drivers/filters, do you have a system user in your passwd file of lp?
On my Ubuntu system they are all owned by root: root@quad:~# for i in $(dpkg -l cups\* | fgrep -w ii | awk '{print $2}'); do dpkg -L $i | xargs ls -ld | fgrep -vw root; done root@quad:~# -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC

On Tue, 16 Jun 2015 08:55:05 PM Chris Samuel wrote:
On Tue, 16 Jun 2015 06:54:44 PM Mark Trickett wrote:
Query on CUPS and printer drivers/filters, do you have a system user in your passwd file of lp?
On my Ubuntu system they are all owned by root:
Sigh, I answered your second question (which I trimmed) and missed the first one that I left there. I blame this cold (to paraphrase Monty Python). To answer the question I missed.. root@quad:~# getent passwd lp lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin root@quad:~# getent group lp lp:x:7: root@quad:~# getent group lpadmin lpadmin:x:117:chris All the best, Chris -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC

Hello Chris, On Tue, 2015-06-16 at 20:58 +1000, Chris Samuel wrote:
On Tue, 16 Jun 2015 08:55:05 PM Chris Samuel wrote:
On Tue, 16 Jun 2015 06:54:44 PM Mark Trickett wrote:
Query on CUPS and printer drivers/filters, do you have a system user in your passwd file of lp?
On my Ubuntu system they are all owned by root:
That is what I see on my Debian 7.8
Sigh, I answered your second question (which I trimmed) and missed the first one that I left there. I blame this cold (to paraphrase Monty Python).
To answer the question I missed..
root@quad:~# getent passwd lp lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
root@quad:~# getent group lp lp:x:7:
root@quad:~# getent group lpadmin lpadmin:x:117:chris
This matches, mostly. I added myself to both lp and lpadmin as I had not read of the instruction to add to the lpadmin group. Still poking around looking for various files here and there, but I think some of the Canon bits may refer to files in places they were in prior incarnations. I am trying to chase round, but going in circles.
All the best, Chris
Regards, Mark Trickett

Chris Samuel <chris@csamuel.org> writes:
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin lp:x:7: lpadmin:x:117:chris
Obs. http://www.debian.org/doc/debian-policy/ch-opersys.html#s9.2.2 If your Debian system lacks the lp<-->7 entry, it's broken. What id you get for lpadmin will depend on the order in which you install packages. As for Ubuntu, I don't know.

re root/lp/lpadmin, brain dump from memory: * debian runs cups as root by default * cups *can* print as non-root user, but * cups wants root to write e.g. ink levels to /etc/cups/printers.conf but that's not strictly needed. I notice subscriptions.conf in there as well. I think maybe KDE users need that to printer properly? cupsd also creates backup files called foo.conf.O. These state values all belong in /var or /run, but cupsd is super dumb. * editing /etc/cups via cupsd (lpadmin or the web UI) probably also needs cupsd to run as root. I usually create printer queues &c by hand, so I didn't investigate. * cups needs root to use cups-pdf queue (because it changes euid to the job owner to write to ~owner/PDF/blah.pdf or so.) * I think cupsd wanted root for one more thing, but I can't remember what it was. * in cups-files.conf I do this: ErrorLog syslog # Use syslog for all logging AccessLog syslog PageLog syslog SystemGroup lpadmin So I guess that's why lpadmin members are special. * by default cupsd doesn't verify the username, so you can trivially do e.g. mallory$ lp -U alice porn.pdf mallory$ cancel -U alice hp4100-1 I think the default <Location> ACLs in cupsd.conf try to limit "dangerous" commands to originate from 127.0.0.1, as a crappy workaround. PS: I only ever cared about networked printers. If your printer is connected over USB or something, cupsd probably needs write access to the relevant device file.
participants (4)
-
Chris Samuel
-
Mark Trickett
-
Russell Coker
-
trentbuck@gmail.com