[Samba] Using parameters in lpq command conflicts with background lpq

Jerry Askew jdaskew-samba at misguru.com
Tue Oct 5 00:13:35 GMT 2004


I have an application than makes use of the "lpq command" and uses the %U parameter in the command string.  The application returns a personalized queue list based on the value of %U.  This technique worked well in older versions of Samba (circa RedHat 8), but I have run into some trouble with Samba 3.  The issue appears to be twofold.

    1)  The lpq command is now run from the background lpq monitoring process, which does not have a "user" (%U) per-se associated with it.

    2)  The background lpq process maintains its cache(s) based on the service name.  IIRC, the older caching system maintained a cache for each unique "lpq command" line.

I've temporarily solved the problem by running smbd from inetd - this prevents the background lpq process from running and causes each user's process to invoke their own lpq command (complete with %U substitution).

Would it be possible to update the background lpq code to use the (fully substituted) lpq command as the cache identifier instead of (or in addition to) the service name?  My application aside, I think it would be best if Samba's behavior was consistent in both daemon and non-daemon modes.  I'd be willing to lend my mediocre programming skills to the task if it would help.

Thank you
-Jerry


More information about the samba mailing list