[cups.bugs] [MOD] STR #1582: NextJobId incorrect after a cupsd crash

jlovell.apple jlovell at apple.com
Fri Apr 21 14:45:00 PDT 2006


[STR New]

NextJobId is incorrect after a cupsd crash.

In the case where the cache is out of date maybe NextJobId should come
from load_request_root() rather than load_next_job_id()...

Steps to reproduce:

- Starting with a clean system:
  # killall cupsd
  # rm -f /var/spool/cups/{c,d}* /var/tmp/cups/job.cache
  # cupsd

- Queue job 1:
  $ lp -H hold main.c
  request id is Lexmark_Z53-1 (1 file(s))

- Cause the job cache to be written:
  # killall cupsd
  # cupsd

- Queue job 2:
  $ lp -H hold job.c
  request id is Lexmark_Z53-2 (1 file(s))

- SIGKILL cupsd & restart it (with an out-of-date cache):
  # killall -9 cupsd
  # cupsd

- Queue what should be job 3:
  $ lp -H hold printers.c
  request id is Lexmark_Z53-2 (1 file(s))

- See two job-2 entries:
  $ lpq
  Lexmark_Z53 is not ready
  Rank    Owner   Job     File(s)                         Total Size
  1st     jlovell 1       main.c                          57344 bytes
  2nd     jlovell 2       job.c                           89088 bytes
  3rd     jlovell 2       printers.c                      88064 bytes

- Confirm the error in the spool dir:
  # ls -l /var/spool/cups/
  total 304
  -rw-------   1 root  lp    646 Apr 21 14:16 c00001
  -rw-------   1 root  lp    654 Apr 21 14:20 c00002
  -rw-r-----   1 root  lp  56944 Apr 21 14:16 d00001-001
  -rw-r-----   1 root  lp  87196 Apr 21 14:20 d00002-001
  drwxrwx--T   2 root  lp     68 Apr 21 13:07 tmp

FWIW this comes from:
<rdar://problem/4501801> scheduled jobs are always given job ID "job 1"

Thanks!

Link: http://www.cups.org/str.php?L1582
Version: 1.2-current





More information about the cups-devel mailing list