2

I have a small Linux server (Ubuntu Server, 12.04 LTS) which is serving as a print release server. Essentially, I have defined a CUPS printer, and added Option job-hold-until indefinite to the entry in printers.conf so guests to the library can pay cash for their printouts, and someone at the desk can click "Release Job" in the CUPS web interface to send it to the printer.

The problem is that periodically the CUPS web interface will stop responding. The error log will fill up with messages like this:

E [10/Sep/2013:13:28:04 -0500] Unable to create certificate file /var/run/cups/certs/0 - Too many open files
E [10/Sep/2013:13:28:04 -0500] [CGI] Unable to create pipe for /usr/lib/cups/cgi-bin/jobs.cgi - Too many open files
E [10/Sep/2013:13:28:04 -0500] Unable to create certificate file /var/run/cups/certs/0 - Too many open files

The bulk of the messages have to do with files that have to do with SSL encryption for the web interface. It appears to be opening them and then never closing them, until it starts hitting the "Too many open files" error.

We don't really need SSL encryption for this. It's already fire-walled off to just IPs for staff computers inside the building. So the first time this happened, I attempted to disable SSL entirely by adding DefaultEncryption Never to cupsd.conf. We can access the web interface without SSL now, but the problem recurred this morning anyway.

So ... how do I persuade CUPS to 1) close the files when it's done with them, or B) not open them in the first place?

1 Answer 1

1

Further research indicated this problem was caused by AppArmor, an Ubuntu security mechanism. It was interfering with CUPS usual access, and CUPS didn't know what to do about it. To resolve the problem, I disabled the CUPS profile in AppArmor:

sudo ln -s /etc/apparmor.d/usr.sbin.cupsd /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.cupsd
2
  • Alas, this answer proved incorrect. I disabled the CUPS AppArmor profile, but the problem recurred. I am un-accepting my own answer. I still have no idea what causes this behavior, but I've ameliorated the symptoms by forcing CUPS to restart every morning at 4 AM using cron. Oct 1, 2013 at 14:04
  • 1
    My issue was very different but thanks to your un-accepted answer I found out AppArmor was the culprit. So, thanks for that :-) I was pointing /var/spool/cups to a secondary disk but CUPS couldn't write until I disabled its AppArmor profile.
    – maganap
    Feb 8, 2022 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .