/etc/printcap is only read while startup and if smbd receives a HUP signal. Therfore adding and removing of printer queues on the CUPS side aren't dynamically noticed. I've turned to the cups.development news group for advice, if there is a push mechanism inside CUPS to inform us or if we have to poll.
Assign it to me, as I've to provide additional input.
From: Michael Sweet <mike at easysw dot com> Newsgroups: cups.development Subject: Re: Samba printer gets out of sync Date: Mon, 12 Apr 2004 14:04:12 -0400 Lars Mueller wrote: > Is it possible from the CUPS side to push an update, prefered by only > passing the information which printer to add or remove, to the Samba > server? Not in 1.1, however CUPS 1.2 adds notification support which can asynchronously notify applications about server, printer, and job changes. > If this isn't possible we have to poll in intervals. Then we need or > maybe must add an option like 'lpstat cache time' with an sensible > default value. This is likely the best option, and I *think* that there is already some logic like this for the job cache.
Created attachment 498 [details] Proposed fix. Adds an option 'printcap cache time'. Documentation is part of the diff. We add an additional timer in check_reload() of smbd/process.c and call remove_stale_printer() - new funtion to smbd/service.c - load_printers() and set the timer to the current time. remove_stale_printer() tales care not to remove the PRINTERS_NAME service.
Please add the patch to the Samba 3.0 tree.
Reopen to be tracked by Jerry.
Created attachment 499 [details] Second draft. Added a lower initial interval to allow a first check already after 60 seconds. This might be usefull if the print subsystem isn't yet ready as part of the system start up. Here our current default of 750 seconds might leave the Samba server for a to long time without printers.
Created attachment 521 [details] Updated man page documentation.
couple of small changes but looks good. CHecked into 3.0/trunk. 'printcap cache time = 0' will be the default in 3.0 for now. but default to 12 & 1/2 minutes in trunk.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.