CUPS 2.0 lpstat and lpinfo commands return "Bad file descriptor"
Solution 1
Ensure also you have Started Cupsd Service
According to the ArchWiki (https://wiki.archlinux.org/index.php/CUPS), the service is called: org.cups.cupsd.service
Check the service by: sudo systemctl status org.cups.cupsd.service
Start (if not started) the service by: sudo systemctl start org.cups.cupsd.service
Enable the service (if not enabled) by: sudo systemctl enable org.cups.cupsd.service
Solution 2
I had the same error message. According to https://bbs.archlinux.org/viewtopic.php?id=185298 , make sure that /etc/cups/client.conf
contains
ServerName /var/run/cups/cups.sock
Solution 3
Just leaving this here in case someone stumbles into the same problem as I did.
I'm running Debian Jessie, which has CUPS 2.0.3 and systemd. During some experiments the socket stopped working and I had the above symptoms. It was enough to systemctl restart systemd.socket
, restarting cups was not enough. Also no config modification, as mentioned in the other answer was necessary.
Solution 4
In addition to the other solutions (which are all valid ones), it can happen when you upgrade your system kernel.
So one can also simply restart its system to ensure everything is right before investigating deeper.
Sav-econ
Updated on June 21, 2022Comments
-
Sav-econ almost 2 years
I have installed cups 2.0 on my Ubuntu box. I installed from source. When I type the first few commands in the CUPS manual it returns the message Bad file descriptor. Here is an example
VPCZ12V9E:~$ sudo lpinfo -m lpinfo: Bad file descriptor VPCZ12V9E:~$ lpstat -p lpstat: Bad file descriptor
Please suggest why this is happening? It implies to me that I have a problem. I have not tried adding a printer yet. I have only installed CUPS 2.0.