Summary of current setup

There is 1 cups server running the new cups component. Its alias is infcups. The profile includes the cups-server.h header and this is where the cups printer resources are defined. (See also ServicesUnitPrinterSetup.)

All other machines run cupsd but use the default cupsd.conf file.

Solving problems

The most common problem when printing stops is that one of the poll machines has 'died'. So, first check which wire the user has tried to print from and check that the 'poll' machine is up and is running cups-polld. If you need to start cups on a client machine, you run /etc/init.d/cups start.

If the poll machine is up and is running cups-polld, then check that cupsd is running on infcups. The cups component is running on infcups so om cups start/stop/restart will work.

Sometimes, the printer state on the web interface shows 'stopped' and the printer icon changed from green to red. See below for more info.

Adding a printer

Edit cups-server.h On infcups, run om cups configure

The cups component allows you to configure most printer options. Look at examples in the header file and the component documentation.

Modifying a printer

Where possible, use the cups-server.h. To change things manually (this is not recommended) there are 2 ways:

Either use lpadmin from the command line or use the web interface (see below).

e.g. lpadmin -pfh10 -o media=A4 -o HPOption_Duplexer=True -o sides=two-sided-long-edge (You can check what the options are currently set at by looking in the appropriate .ppd file in /etc/cups/ppd or in the printers.conf file.)

The web interface

Kick off a browser from infcups and go to localhost:631. From here, under Printers, select the printer you want to edit and select Set Printer Options. It's pretty intuitive from there and is password protected. If a printer state is showing as 'stopped', you can click on Start Printer.

However, I can't make changes on infcups. I'm probably missing something really obvious but a bar of chocolate to the first person who can get it to work (and tells me what I'm doing wrong!).

So, at the moment, unless you solve the 'infcups' web interface issue, if you are changing a characteristic not defined as a cups resource, you need to use lpadmin. If a printer gets itself into the Stopped state, you can run cupsenable from the command line and then restart the component.

Fixing known problems

Printer if413m0 in particular keeps getting in to a disabled/stopped state. On the web interface, if you go to the page for if413m0 and click on if413m0 in big orange letters, you may see that there are jobs stopped. You can either remove them or try to restart them.

To remove them, you run lprm <job_id>

To restart them, you run lp -P<printer> -i <job_id> -H restart

To check the queue, you run lpstat -P <printer>

In general, when a printer is red on the web interface, this means there is a problem. It can usually be fixed by a combination of removing print jobs (lprm) and running cupsenable.

When a printer is orange/yellow on the web interface, this usually means a less serious problem ranging from the job waiting because there is no toner or paper, a secure job has been sent and is awaiting user intervention or even that network connectivity has been lost.

Killing stuck processes

To delete all jobs in a queue, as root on infcups do

lprm -P at14 -

Find out what the printer is really called from the interface or by doing

host at14

at14.inf.ed.ac.uk is an alias for chandler.inf.ed.ac.uk

Then check for any stuck processes

ps -ef | grep chandler

It displays something like:

root     11124 29810  0 11:08 ?        00:00:00 ipp://chandler.inf.ed.ac.uk:631/ipp 539503 s0967790 QUAX 1 document-name=CDTx0H InputSlot=Auto PageSize=A4 job-uuid=urn:uuid:05808e93-3991-33b9-4a8f-fa41be1352e3 

To kill that process do

kill -9 11124

print a test page / power cycle if necessary

Pausing queues

Queues can be paused with the cupsdisable command:

/usr/sbin/cupsdisable <printer>

Disabling queues

cupsdisable does not prevent jobs being submitted to the queue. If you want to completely stop jobs, you also need to do the lpadmin and reject commands:

cupsdisable at14; lpadmin -p at14 -o printer-is-shared=false ; reject -r "printer malfunction" at14

so on the interface it says

Printer State: stopped, rejecting jobs, not published.

NEW to do these 3 steps in one command:

/usr/local/bin/disable-queue

To restart the queue:

lpadmin -p at14 -o printer-is-shared=true ; accept at14 ; cupsenable at14

NEW to do these 3 steps in one command:

/usr/local/bin/enable-queue

Removing unwanted queues

To remove a queue that you have mistakenly created, use the command:

lpadmin -x <printer queue>

Gotchas

When you check a queue by doing:

lpq -P <printer>

It displays something like:

1st     s078711 15027   2nd     tsw     15161   Extension desk                  51200 bytes

Note that it only displays 7 characters of the uun and not 8 as expected!

-- AlisonDownie - 11 Oct 2007


This topic: DICE > WebHome > ServicesUnit > ServicesUnitCupsSetup
Topic revision: r43 - 09 Feb 2015 - 09:09:41 - RogerBurroughes
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies