On 20/10/10 15:36, Tim Waugh wrote:
So yes, Create-Job-Subscription and Create-Printer-Subscription require authentication. Currently system-config-printer's CUPS monitor module does not support using authentication for that, and it isn't really meant to handle automatic updating if it can't use subscriptions.
It does seem to happen continually even when there is no activity, as fast as CUPS can respond - which is presumably why the CPU% of cupsd rises to 99%.
I think I might have found the problem. When it fails to get notifications (because there is no subscription to use), it refreshes the entire list of printers and jobs... and tries to create another subscription.
Should be fixed upstream now, in that it won't try to automatically update printers and jobs if subscriptions cannot be used.
Would you be able to try it out? Just down monitor.py from the current 1.2.x branch and use it as a replacement for the one in 1.2.5: http://git.fedorahosted.org/git/?p=system-config-printer.git;a=blob_plain;f=...
Thanks, Tim.
I tried 1.2.5 with the new monitor.py before adding Create-Printer-Subscription (we already had Create-Job-Subscription as my lisy showed) and saw:
./system-config-printer-applet --debug system-config-printer-applet: failed to start NewPrinterNotification service refresh <monitor.Monitor instance at 0x9320dac>: CUPS IPP error (1025, 'client-error-forbidden') <monitor.Monitor instance at 0x9320dac>: printers and jobs lists provided Upset printers: set([]) open notifications: 0 num_jobs: 0 num_jobs_when_hidden: 0 update_jobs Got 0 jobs, asked for 1 update_jobs
Then I added Create-Printer-Subscription to the cupsd.conf and restarted cupsd and tried again:
; ./system-config-printer-applet --debug system-config-printer-applet: failed to start NewPrinterNotification service refresh Created subscription 3, events=['printer-added', 'printer-deleted', 'printer-state-changed', 'job-created', 'job-completed', 'job-stopped', 'job-state-changed', 'job-progress'] Next notifications fetch in 1s <monitor.Monitor instance at 0x9befdac>: printers and jobs lists provided Upset printers: set([]) open notifications: 0 num_jobs: 0 num_jobs_when_hidden: 0 Deferred get_notifications by 200ms update_jobs Got 0 jobs, asked for 1 update_jobs get_notifications update_jobs Next notifications fetch in 60s get_notifications 1 job-created Job created. {'job-impressions-completed': 0, 'job-name': u'291010.pdf', 'job-state': 4, 'job-state-reasons': u'job-hold-until-specified', 'notify-charset': u'utf-8', 'notify-job-id': 22968, 'notify-natural-langugage': u'en-us', 'notify-printer-uri': u'ipp://ness.cs.york.ac.uk:631/printers/cp001', 'notify-sequence-number': 1, 'notify-subscribed-event': u'job-created', 'notify-subscription-id': 3, 'notify-text': u'Job created.', 'printer-is-accepting-jobs': True, 'printer-name': u'cp001', 'printer-state': 3, 'printer-state-reasons': [u'none'], 'printer-up-time': 1287593697} 2 printer-state-changed Printer "cp001" state changed to password. {'notify-charset': u'utf-8', 'notify-natural-langugage': u'en-us', 'notify-printer-uri': u'ipp://ness.cs.york.ac.uk:631/printers/cp001', 'notify-sequence-number': 2, 'notify-subscribed-event': u'printer-state-changed', 'notify-subscription-id': 3, 'notify-text': u'Printer "cp001" state changed to password.', 'printer-is-accepting-jobs': True, 'printer-name': u'cp001', 'printer-state': 4, 'printer-state-reasons': [u'none'], 'printer-up-time': 1287593697} 3 job-state-changed Job #22968 started. {'job-impressions-completed': 0, 'job-name': u'291010.pdf', 'job-state': 5, 'job-state-reasons': u'job-printing', 'notify-charset': u'utf-8', 'notify-job-id': 22968, 'notify-natural-langugage': u'en-us', 'notify-printer-uri': u'ipp://ness.cs.york.ac.uk:631/printers/cp001', 'notify-sequence-number': 3, 'notify-subscribed-event': u'job-state-changed', 'notify-subscription-id': 3, 'notify-text': u'Job #22968 started.', 'printer-is-accepting-jobs': True, 'printer-name': u'cp001', 'printer-state': 4, 'printer-state-reasons': [u'none'], 'printer-up-time': 1287593697} update_jobs <monitor.Monitor instance at 0x9befdac>: printer `cp001' has event `printer-state-changed' Next notifications fetch in 60s ...
However, the %CPU of the cupsd doesn't rise greatly as it did before. Though I never see the GUI display of printers, which is weird!
I'd like to know where the '60s' interval comes from - is it hard-wired in the code, or something configurable in CUPS?