7

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.

Sav-econ
  • 297
  • 1
  • 2
  • 14

5 Answers5

7

Ensure also you have Started Cupsd Service

Marcelo Ruggeri
  • 1,939
  • 1
  • 17
  • 10
  • Maybe the service name has changed or something... I just now started the services cups.service, cups.path, and cups.socket in order to make my printer start working again. (I don't know whether all three were needed, but enabling cups.service caused the enablement of the other two, so I thought that I'd better start all three since they seemed to want to be together.) But other than that difference this answer solved my problem. – mjwach Jan 23 '21 at 02:33
5

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
jrouquie
  • 4,315
  • 4
  • 27
  • 43
2

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.

TBR
  • 2,790
  • 1
  • 12
  • 22
1

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.

Sylver
  • 2,285
  • 3
  • 29
  • 40
-1

Just to throw in my 2 cents:

I got this message because I forgot to open Port 631. Test if the port is open with:

nc -zv <hostname> 631
mathause
  • 1,607
  • 1
  • 16
  • 24
  • What do I get if it is closed? How do I open it? – Ingo Sep 17 '20 at 23:30
  • I get `No route to host` if it is closed and `succeeded` if it is open and that is a totally different question that depends on your firewall and network setup. Not sure how that merits a downvote... – mathause Sep 18 '20 at 11:42