The Samba-Bugzilla – Bug 7994
cups async printcap retrieval does not notify parent smbd of error status
Last modified: 2011-09-06 10:06:15 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.
Created attachment 6292 [details]
multi-printer samba-cups printcap test script
Fix d6cb4feae1eab22d63b42eb5c480578fb1ee99bf now in master.
needs to be addressed in 3.5 as well
Created attachment 6481 [details]
3.5 variant of that patch
Created attachment 6482 [details]
3-4-test variant of that patch
Karolin, please add to 3.5 and 3.4. Thanks.
Pushed to v3-4-test and v3-5-test.
Closing out bug report.
(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.
(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).
The printcap IDL change is now included in 3.4, 3.5, 3.6 and master branches. This bug can be closed IMO.
I've recently tested this manually and it works as expected. Closing.