Bug 7994 - cups async printcap retrieval does not notify parent smbd of error status
cups async printcap retrieval does not notify parent smbd of error status
Status: RESOLVED FIXED
Product: Samba 3.6
Classification: Unclassified
Component: Printing
unspecified
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-09 16:12 UTC by David Disseldorp
Modified: 2011-09-06 10:06 UTC (History)
0 users

See Also:


Attachments
multi-printer samba-cups printcap test script (2.45 KB, text/plain)
2011-03-15 13:03 UTC, David Disseldorp
no flags Details
v3-5-test.patch (32.22 KB, patch)
2011-05-24 11:37 UTC, Guenther Deschner
asn: review+
gd: review+
Details
v3-4-test.patch (32.36 KB, patch)
2011-05-24 11:58 UTC, Guenther Deschner
asn: review+
gd: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Disseldorp 2011-03-09 16:12:25 UTC
Currently cups printcap retrieval occurs in the following manner:
- the parent smdb forks a child process and waits on an fd for printcap data
- the child process retrieves a printer list from cups
- the child process writes the printer list to the fd
- the parent reads the new printer list from the fd

Marshalling and unmarshalling of the printer list is done in an ad hoc fashion. The parent smbd is not made aware of any errors encountered by the child process, therefore it cannot distinguish between an empty printer list and an error (e.g. child cannot connect to cups).

This IPC should be converted to use an IDL for simplification and error reporting.
Comment 1 David Disseldorp 2011-03-15 13:03:32 UTC
Created attachment 6292 [details]
multi-printer samba-cups printcap test script
Comment 2 David Disseldorp 2011-03-16 16:56:01 UTC
Fix d6cb4feae1eab22d63b42eb5c480578fb1ee99bf now in master.
Comment 3 Guenther Deschner 2011-05-24 11:36:56 UTC
needs to be addressed in 3.5 as well
Comment 4 Guenther Deschner 2011-05-24 11:37:56 UTC
Created attachment 6481 [details]
v3-5-test.patch

3.5 variant of that patch
Comment 5 Guenther Deschner 2011-05-24 11:58:12 UTC
Created attachment 6482 [details]
v3-4-test.patch

3-4-test variant of that patch
Comment 6 Guenther Deschner 2011-05-24 12:43:43 UTC
Karolin, please add to 3.5 and 3.4. Thanks.
Comment 7 Karolin Seeger 2011-05-26 18:25:33 UTC
Pushed to v3-4-test and v3-5-test.
Closing out bug report.

Thanks!
Comment 8 Guenther Deschner 2011-05-27 18:59:15 UTC
(In reply to comment #1)
> Created attachment 6292 [details]
> multi-printer samba-cups printcap test script

David, can you tell me what configuration (printcap cache time, etc.) one need in order to successfully run that script for verification purpose ? Thanks.
Comment 9 David Disseldorp 2011-05-27 20:09:42 UTC
(In reply to comment #8)
> (In reply to comment #1)
> > Created attachment 6292 [details] [details]
> > multi-printer samba-cups printcap test script
> 
> David, can you tell me what configuration (printcap cache time, etc.) one need
> in order to successfully run that script for verification purpose ? Thanks.

"printcap = cups" should be all you need, it sleeps "printcap cache time" seconds to check if changes are picked up on expiry.

SMBD_HOUSEKEEPING_INTERVAL is currently set at 60 seconds, so I'd advise setting "printcap cache time" to a multiple (e.g. 120).
Comment 10 David Disseldorp 2011-09-01 11:44:35 UTC
The printcap IDL change is now included in 3.4, 3.5, 3.6 and master branches. This bug can be closed IMO.
Comment 11 Andreas Schneider 2011-09-06 10:06:15 UTC
I've recently tested this manually and it works as expected. Closing.