Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#57427 - [cups] lp: Error - scheduler not responding

Attached to Project: Arch Linux
Opened by Christian Rebischke (Shibumi) - Thursday, 08 February 2018, 01:23 GMT
Last edited by Eli Schwartz (eschwartz) - Friday, 16 February 2018, 06:24 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Hello,
I have read the this articles:

https://bbs.archlinux.org/viewtopic.php?id=234267
https://bbs.archlinux.org/viewtopic.php?id=234203

Both doesn't help. When I try to run `lp` the process can't connect to the cups daemon. I am sure this has something todo with the sysusers changes for cups. some versions before it has definitly worked.

# ls -l /etc/cups/
Here is some information:
-rw------- 1 root lp 0 Jan 27 10:26 classes.conf
-rw-r--r-- 1 root lp 26953 Jan 29 20:48 cups-browsed.conf
-rw-r----- 1 root lp 6346 Jan 27 10:26 cupsd.conf
-rw-r----- 1 root lp 6346 Jan 27 10:26 cupsd.conf.default
-rw-r----- 1 root lp 2943 Jan 27 10:26 cups-files.conf
-rw-r----- 1 root lp 2943 Jan 27 10:26 cups-files.conf.default
drwxr-xr-x 2 root lp 4096 Dec 19 12:50 ppd
-rw------- 1 root lp 527 Dec 19 16:21 printers.conf
-rw------- 1 root lp 909 Jul 20 2017 printers.conf.O
-rw-r----- 1 root lp 142 Jan 27 10:26 snmp.conf
-rw-r----- 1 root lp 142 Jan 27 10:26 snmp.conf.default
drwx------ 2 root lp 4096 Feb 5 2016 ssl
-rw-r--r-- 1 root lp 0 Jan 27 10:26 subscriptions.conf


# sudo systemctl status org.cups.cups.d
● org.cups.cupsd.service - CUPS Scheduler
Loaded: loaded (/usr/lib/systemd/system/org.cups.cupsd.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2018-02-08 02:21:57 CET; 9s ago
Docs: man:cupsd(8)
Main PID: 8828 (cupsd)
Status: "Scheduler is running..."
Tasks: 1 (limit: 4915)
CGroup: /system.slice/org.cups.cupsd.service
└─8828 /usr/bin/cupsd -l

Feb 08 02:21:56 motoko systemd[1]: Starting CUPS Scheduler...
Feb 08 02:21:57 motoko systemd[1]: Started CUPS Scheduler.


$ id
uid=1000(chris) gid=1000(chris) groups=1000(chris),7(lp),10(wheel),150(wireshark)

This task depends upon

Closed by  Eli Schwartz (eschwartz)
Friday, 16 February 2018, 06:24 GMT
Reason for closing:  Not a bug
Additional comments about closing:  user error
Comment by Christian Rebischke (Shibumi) - Thursday, 08 February 2018, 01:31 GMT
I've read the pacman log. According to the pacman log I have to do this:
```
[ALPM-SCRIPTLET] Cups daemon is now running under "cups" user+group.
[ALPM-SCRIPTLET] Please make sure to enable the new user+group change in
[ALPM-SCRIPTLET] /etc/cups/cups-files.conf or merge changes from
[ALPM-SCRIPTLET] /etc/cups/cups-files.conf.default. After a service restart
[ALPM-SCRIPTLET] make sure /etc/cups and all files within are owned by
[ALPM-SCRIPTLET] cups group - run "chgrp -R cups /etc/cups".
```

I did:
chgrp -R cups /etc/cups

I have checked /etc/cups/cups-files.conf and /etc/cups/cups-files.conf.default (they are both the same)

I have added myself to the user group cups.

and did a org.cups.cupsd restart...

I still get a timeout while connecting to the cups daemon.
Comment by Andreas Radke (AndyRTR) - Thursday, 08 February 2018, 14:31 GMT
Have you done a server restart? Have you tried to remove/readd the printer? It looks more like a configuration issues.

You should also run the daemon in debug mode and check the log files and command line where you call lp.
Comment by Christian Rebischke (Shibumi) - Thursday, 08 February 2018, 17:14 GMT
Yep, I did a server restart and even complete reboot.
I don't think this is a printer configuration issue.
If it would be I could at least get a printer status via `lpstatus` or `lpq`.
But I can't trigger any `lp*` command because my user can't connect to the server.
The Access log seems to log only the access on the http frontend of cups.

That's my cups-files.conf: https://paste.xinu.at/Q6B/

My cups directory looks like this:
```
-rw------- 1 0 209 0 Jan 27 10:26 classes.conf
-rw-r--r-- 1 0 209 26953 Jan 29 20:48 cups-browsed.conf
-rw-r----- 1 0 209 6346 Jan 27 10:26 cupsd.conf
-rw-r----- 1 0 209 6346 Jan 27 10:26 cupsd.conf.default
-rw-r----- 1 0 209 2943 Jan 27 10:26 cups-files.conf
-rw-r----- 1 0 209 2943 Jan 27 10:26 cups-files.conf.default
drwxr-xr-x 2 0 209 4096 Dec 19 12:50 ppd
-rw------- 1 0 209 527 Dec 19 16:21 printers.conf
-rw------- 1 0 209 909 Jul 20 2017 printers.conf.O
-rw-r----- 1 0 209 142 Jan 27 10:26 snmp.conf
-rw-r----- 1 0 209 142 Jan 27 10:26 snmp.conf.default
drwx------ 2 0 209 4096 Feb 5 2016 ssl
-rw-r--r-- 1 0 209 0 Jan 27 10:26 subscriptions.conf
```

cups group is 209. So it looks ok. I really have no clue about the issue.

I have checked other cups directories like `/var/spool/cups`.
In this directory I can find a lot of files owned by root:lp. Shouldn't that be group cups?
Comment by Andreas Radke (AndyRTR) - Thursday, 08 February 2018, 17:33 GMT
root@laptop64:/root # ls -lha /var/spool/cups/tmp/
insgesamt 8,0K
drwxrwx--T 2 root cups 4,0K 8. Feb 16:45 .
drwx--x--- 3 root cups 4,0K 8. Feb 16:45 ..
-rw------- 1 cups cups 0 8. Feb 16:45 cups-dbus-notifier-lockfile
Comment by Christian Rebischke (Shibumi) - Thursday, 08 February 2018, 21:57 GMT
I did:
chgrp cups /var/spool/cups/

/var/spool/cups/tmp was empty...
After this I restarted cups service:
The service is running. But same behaviour as before. I can't connect to the cups server with my user.
With root it works fine, but not with my user. Although he is member of cups group:

uid=1000(chris) gid=1000(chris) groups=1000(chris),10(wheel),150(wireshark),209(cups)

Comment by loqs (loqs) - Thursday, 08 February 2018, 22:49 GMT
If you remove the user from the cups group any change?
If you stop the service make User daemon Group lp in cups-files.conf chown -R root:lp /etc/cups then start the service again do the lp commands resume functioning?
Comment by Christian Rebischke (Shibumi) - Saturday, 10 February 2018, 02:55 GMT
I have removed my user from the cups group now.. I will see if this changes something on the next login.
Comment by Christian Rebischke (Shibumi) - Saturday, 10 February 2018, 21:37 GMT
Ok, I have checked it. Same behaviour. I can't connect to the cups server. In my journal, I see nothing. Except:
"Feb 10 22:35:20 motoko colord-sane[3605]: io/hpmud/musb.c 2099: Invalid usb_open: Permission denied"

This is the scanner (the scanner is part of the printer). So there have to be some permission problem..
Comment by Christian Rebischke (Shibumi) - Saturday, 10 February 2018, 21:39 GMT
Running `lpstat` outputs: "lpstat: Bad file descriptor"
Running `lpq` outputs: "lpq: Unable to connect to server"

When I try to open chromium print dialog it's just loading infinitly...
Comment by Christian Rebischke (Shibumi) - Saturday, 10 February 2018, 21:39 GMT
Before the sysusers change for cups everything was running fine :S
Comment by loqs (loqs) - Saturday, 10 February 2018, 22:01 GMT
The cups group does not replace the lp group in granting access to devices. Unprivileged sub processes now run cups:cups in two cases they run cups:cups+lp previously they ran deamon:lp
Comment by Christian Rebischke (Shibumi) - Sunday, 11 February 2018, 01:43 GMT
ok any other idea how I can debug or fix this?
Comment by loqs (loqs) - Sunday, 11 February 2018, 15:01 GMT
LogLevel debug2 and watch error_log for new output when you use an lp command.
As mentioned only two sites were altered to allow additional sites you could modify additional exec call sites to either remain as root:root as a quick test or add additional group memberships.
Comment by Christian Rebischke (Shibumi) - Monday, 12 February 2018, 10:58 GMT
Well, invoking lpq, lpr or any other lp command works fine with root.. so it's definitly a permission issue.
Comment by Christian Rebischke (Shibumi) - Friday, 16 February 2018, 05:56 GMT
Ok after reinstalling the whole cups installation and still had the same problem I have found the reason for it. Seems like I created a ~/.cups/lpconfig file with a default network router and this network router (of course) wasn't available.. thats the reason why it hangs so much. Sorry for the noise guys but thanks for your effort. If we ever see each other remind me on this issue and I will spend a beer ;)

Loading...