[cups.development] notifiers and subscriptions

Jerome Alet alet at librelogiciel.com
Thu Jun 22 14:53:58 PDT 2006


On Thu, Jun 22, 2006 at 08:55:09AM -0400, Michael Sweet wrote:
> 
> >does this mean that a particular notifier is launched a single time and 
> >will remain launched to process all the events until CUPS is stopped
> >or the subscription is deleted ?
> 
> Yes, or if the notifier crashes or exits.
> 
> >at first glance I thought a notifier was launched each time a new
> >event appeared, processed a single event and exited.
> 
> No, a notifier is normally active for the life of the subscription,
> starting with the first event.  The notifier may implement a timeout
> which causes it to exit early, and cupsd will automatically restart
> the notifier as needed.

Then I think I've found something which looks like a bug :

--- CUT ---
I [22/Jun/2006:23:09:35 +0200] Saving printers.conf...
d [22/Jun/2006:23:09:35 +0200] cupsdCheckJobs: 0 active jobs, sleeping=0, reload=0
D [22/Jun/2006:23:09:35 +0200] cupsd_send_notification(sub=0x80e2a30(1), event=0x80d3650(printer-added))
d [22/Jun/2006:23:09:35 +0200] start_notifier: Adding fd 11 to InputSet...
d [22/Jun/2006:23:09:35 +0200] cupsdStartProcess("/usr/lib/cups/notifier/notifier.py", 0xbfe0fbdc, 0xbfe0f894, 13, -1, 12)
D [22/Jun/2006:23:09:35 +0200] Notifier notifier.py started - PID = 32263
D [22/Jun/2006:23:09:35 +0200] sub->pipe=14
I [22/Jun/2006:23:09:35 +0200] Saving subscriptions.conf...
I [22/Jun/2006:23:09:35 +0200] New printer "Parallel_Port_1" added by "root".
D [22/Jun/2006:23:09:35 +0200] cupsdProcessIPPRequest: 8 status_code=0 (successful-ok)
....
d [22/Jun/2006:23:09:35 +0200] process_children()
D [22/Jun/2006:23:09:35 +0200] PID 32263 (/usr/lib/cups/notifier/notifier.py) exited with no errors.
....
D [22/Jun/2006:23:10:00 +0200] CUPS-Delete-Printer ipp://localhost/printers/Parallel_Port_1
d [22/Jun/2006:23:10:00 +0200] delete_printer(0x80d5dd0[8], ipp://localhost/printers/Parallel_Port_1)
d [22/Jun/2006:23:10:00 +0200] cupsdFindPolicyOp(p=0x80a14b0, op=4004(CUPS-Delete-Printer))
d [22/Jun/2006:23:10:00 +0200] cupsdFindPolicyOp: Found exact match...
d [22/Jun/2006:23:10:00 +0200] cupsdIsAuthorized: con->uri="/admin/", con->best=0x80a8540((null))
d [22/Jun/2006:23:10:00 +0200] cupsdIsAuthorized: level=AUTH_USER, type=AUTH_BASIC, satisfy=AUTH_SATISFY_ALL, num_names=1
d [22/Jun/2006:23:10:00 +0200] cupsdIsAuthorized: op=4004(CUPS-Delete-Printer)
d [22/Jun/2006:23:10:00 +0200] cupsdIsAuthorized: auth=AUTH_ALLOW...
d [22/Jun/2006:23:10:00 +0200] cupsdIsAuthorized: username="root"
d [22/Jun/2006:23:10:00 +0200] cupsdCheckJobs: 0 active jobs, sleeping=0, reload=0
D [22/Jun/2006:23:10:00 +0200] cupsd_send_notification(sub=0x80e2a30(1), event=0x80f3688(printer-deleted))
D [22/Jun/2006:23:10:00 +0200] sub->pipe=14
E [22/Jun/2006:23:10:00 +0200] Unable to send event for subscription 1 (notifier.py:coucou)!
I [22/Jun/2006:23:10:00 +0200] Saving subscriptions.conf...
I [22/Jun/2006:23:10:00 +0200] Printer "Parallel_Port_1" deleted by "root".
--- CUT ---

>From CUPS 1.2.1-2 (Debian standard package) web interface, I've 
first added a printer.

My own notifier was launched, and exited successfully.

Then from the web interface I deleted the printer.

Then CUPS was unable to restart the notifier.

The pipe object should have been closed but wasn't it seems.

My subscriptions.conf follows :

--- CUT ---
# Subscription configuration file for CUPS v1.2.1
# Written by cupsd on 2006-06-22 23:11
NextSubscriptionId 2
<Subscription 1>
Events printer-added printer-deleted
Owner pykota
Recipient notifier.py:coucou
LeaseDuration 0
Interval 0
ExpirationTime 0
NextEventId 18
</Subscription>
--- CUT ---

hoping this helps

bye

Jerome Alet





More information about the cups mailing list