Search code examples
cups

More Complete List of CUPS printer-state-reasons


In RFC8011 p.152 there is a common list of state-reasons that a printer can have. In my testing, this list seems to be very incomplete. Is there a more complete list available for CUPS?

Some examples of printer status state-reasons that are not listed:

  • cups-waiting-for-job-completed
  • offline-report

I'm sure there are many more examples but these are the ones I've found and recorded.


Solution

  • Edit: M. Sweet was nice enough to provide this list from IANA: https://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml

    The cups source code seems to illustrate quite a few state reasons that don't appear in that RFC. Since the same author -- M. Sweet authors both the RFC as well as maintains the CUPS source code, this may be worth file as a bug report on GitHub to see why the two have diverged.

    For example, in 2013, cups-waiting-for-completed was added and about a day later was renamed to cups-waiting-for-job-completed, which came 4 years before the latest 2017 release of the RFC.

    The RFC mentions the following codes in the following order:

    none
    other
    developer-low
    door-open
    fuser-over-temp
    fuser-under-temp
    input-tray-missing
    interlock-open
    interpreter-resource-unavailable
    marker-supply-empty
    marker-supply-low
    marker-waste-almost-full
    marker-waste-full
    media-empty
    media-jam
    media-low
    media-needed
    moving-to-paused
    opc-life-over
    opc-near-eol
    output-area-almost-full
    output-area-full
    output-tray-missing
    paused
    shutdown
    spool-area-full
    stopped-partly
    stopping
    timed-out
    toner-empty
    toner-low
    

    However the source code of job.c seems to also mention the following statuses (including the two mention in the question). I think this makes an exhaustive list until more come along.

    connecting-to-device
    offline-report
    cups-insecure-filter-warning
    cups-missing-filter-warning
    cups-remote-aborted
    cups-remote-canceled
    cups-remote-completed
    cups-remote-pending
    cups-remote-pending-held
    cups-remote-processing
    cups-remote-stopped
    cups-waiting-for-job-completed
    

    As to the best way to track the addition of new keywords, M. Sweet may also be able to provide information on where the new state keywords are derived. Here's the commit description of what seems to have prompted the cups-waiting-for-job-completed.

    msweet committed on Nov 6, 2013 Dropped "dark wake" support on OS X, which was preventing portables from going to sleep when there was a stuck job. We now use a variation of the CUPS 1.4 sleep support to do a cleaner sleep <rdar://problem/14323704> Aside from removing all of the power assertions, we now track a new "cups-waiting-for-completed" state keyword that tells cupsd it can SIGKILL a backend without side-effects - then if we are just waiting for the job to complete we can go to sleep immediately.