-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFE] Implement printer profiles #2
Comments
@zdohnal We don't want an operation for this, we want it to be in file(s) that can be installed. |
Hi @michaelrsweet , Either way, I can't help to not to see a classic PPD déjavu - in both cases above we need to count on profiles being generated and maintained correctly instead of having a full control over them. We would have to keep stable a whole profile file structure or coordinate with known profile implementations if we make some changes - it looks like a bigger challenge than keeping IPP request format stable. Ad clients creating profiles - I guess we can add the functionality into lpadmin/cups web ui and cups-browsed, but I'm not sure how GTK or other GUI apps will be interested in writing profiles. What do you think? |
@zdohnal So the point of my "profiles" featurette in my CUPS slides was not to provide a way to further inject PPDs into the system but to provide a simple way for enterprises to configure/deploy IPP Everywhere queues (pointed at real printers, a central CUPS server, etc.) when mDNS/DNS-SD wasn't feasible - basically duplicating what Apple has done for iOS/iPadOS/macOS and what hundreds of users have been asking for over the years on Linux (re: supporting multiple ServerName directives in client.conf). We can keep the format dirt simple, e.g.:
Then libcups just contacts each of the hosts during enumeration and lists any it can contact. The auto-assigned names can use either the reported DNS-SD name (from the (the same approach would be used for LDAP support, whenever we decide to implement that again using the IETF-published schema...) |
That wasn't what I meant by PPD dejavu remark, I'm sorry, if it sounded like that - I'll explain later.
That would be great if However this feature will set the same default options for such queues in user's print dialog as the default options, which the queue has on the server/device - which sometimes differs from the default options user wants - it will become annoying to set the default options every time you want to print. Based on the info above, we still would have needed a new file and a new format (or adding it to printers.conf), f.e. like:
Additionally - IIUC the permanent queues are planned to go away in the future and that's the source of other mentioned use cases (different default options, 1 device to N queues), which printer profiles can support in addition to the idea what you meant in CUPS slides (althought IIRC you proposed using printer profiles for other mentioned user cases as well when we were discussing CUPS with other maintainers at the time of forking CUPS). And if user can change options to set new default values in print dialog, something will need to do it for him (I cannot expect an user creating a xml file by themselves), so the options are following:
IMHO it is more feasible to adjust clients to do a request than implement a profile writer, so that's why I proposed a new request type - but I wasn't that sure if we aren't restricted by RFC and PWG standards for IPP, but I didn't find IPP_OP_CREATE_LOCAL_PRINTER operation in the standard either, so I guess it's fine.
IMO if we can decide what to use based on path in uri. If it contains
I'm not aware about anyone who uses LDAP for printing right now, so we can leave it out for now - we can reevaluate if there is a demand. @michaelrsweet Thoughts? |
@zdohnal As far as I currently understand it it seems The cupsd itself in the upcoming new CUPS will be stateful because In contrast in current CUPS there is a persistently stored state If my understanding is right that CUPS will become basically "stateless" With "traditional print server functionality in a managed environment" I mean: An admin specifies his intended print server functionality persistently in config files With "persistently (in config files)" I mean that what the admin specified persists. E.g. when the admin specified a print queue with certain print queue specific settings Bottom line from my point of view as far as I currently understand it: |
@zdohnal WRT default options, the existing lpoptions support (which has been in CUPS since v1.1) is intended to provide the overrides you seek. The server/printer-side defaults are the base, then any local admin-defined defaults (in /etc/cups/lpoptions), then finally any per-user defaults (in ~/.cups/lpoptions). I don't want to add yet another way to specify/override default values as we have enough trouble getting applications to support the current API. The profile mechanism should be hooked into the client side code (so libcups, not cupsd) and should transparently show up in the output from cupsGetDests and cupsEnumDests so that applications don't need to change. Just as for printers discovered via DNS-SD, a temporary queue will be created to handle spooling and filtering the first time you print to a profile printer. |
@jsmeix So if you look at my most recent CUPS slide deck, one of my proposed future architectural changes is to split cupsd into two services - a per-user "local server" that handles the normal printing tasks and a system-wide "sharing server" that would provide persistent queues, ACLs, accounting, etc. Most users would never install the sharing server. |
@michaelrsweet I had read So as far as I now understand things: The CUPS 3.0 Local Server basically provides what normal end-users usually need The CUPS 3.0 Sharing Server basically provides what admins in a managed environment need |
@jsmeix Right. And since the sharing server doesn't have to deal with drivers it can (hopefully) end up providing a lot better support for accounting and other enterprise-y features... :) |
Before I was corrected by @michaelrsweet in the next comment, I thought there will be no permanent queues in CUPS model in the future, so I thought additional features for profiles will be needed to cover the functionality, which was provided by permanent queues. |
Aha, ok - so I've tried:
, the option was applied and a permanent queue was created (so GTK will now get two same queues again :( ...), but I can see the correct default option for both. The questions are:
This way, a normal permanent queue would change the option's value listed by
Is it expected or is it a bug?
As permanent queues will not go away, there is no need for applications to create profiles, so no need for adding new operations.
I mentioned cupsd because that was the place where the proposed operation was supposed to be implemented.
Agreed. |
@zdohnal OK, so I think there are still some misconceptions about this. First, using lpoptions to set default options should definitely not be creating a permanent queue (or converting a temporary queue into a permanent one) - lpoptions is all client-side and should not affect server state. Moreover, lpoptions has dealt with temporary queues since the beginning when cupsd would create an delete local queues via the old CUPS browsing mechanism, so there is NO requirement for lpoptions to work with permanent queus. So if you are seeing permanent queues getting created, that is a bug (and please file it separately...) Second, I hope I've made it clear that the local server is supposed to be very lightweight with no permanent queues, no web interface, and very little that can be configured. It is, by design, a transient thing that comes and goes only to handle whatever print jobs the user sends to a printer or print server. Printers and servers that are setup via profiles contribute to the list of potential destinations for the user to pick but queues for them are only created as needed and destroyed when not. Think of them like you are sending an email to someone - you don't keep a persistent connection to a particular mail server on the chance you might send an email to it, you connect as needed based on the messages being sent. Using lpadmin to change the default option value doesn't convert a temporary queue into a permanent one, although if you specify "-o printer-is-temporary=false", it will. I'm not sure why you are seeing what you are seeing unless cupsd is going away between the lpadmin and lpoptions commands - it isn't what I would expect, but then there is no place for the default values to go when it is a temporary queue so I am not surprised either... |
@zdohnal
So when lpoptions stores some setting for a temporary queue Again: This is the old behaviour which might have meanwhile changed. |
@michaelrsweet I think a clear distinction is good (and avoids false expectations): The CUPS 3.0 Local Server is has intentionally "plug-and-play/pray" semantics. Users who need something special (i.e. where the Local Server |
Something general to find out if my understanding is right: I think current CUPS is only for "admins in a managed environment". To print on a printer normal (unexperienced) end-users must first There is additional software (various kind of automated print queue setup tools) With the new CUPS 3.0 Local Server normal end-users can stay normal end-users The CUPS 3.0 Sharing Server is still for "admins in a managed environment". |
@jsmeix Current CUPS supports temporary queues for IPP Everywhere printers (which includes printers shared from another CUPS server and certified IPP Everywhere/AirPrint/Mopria printers), and assuming that the desktop toolkits use the provided CUPS APIs they should provide access to those printers without requiring the user to setup a queue at all. I honestly don't print from Linux desktop applications enough to know whether they are using the APIs we've provided for this, but that has been the goal since CUPS 2.0 (and the APIs have been around since CUPS 1.4...) |
Now it has become obvious that I know basically nothing at all about IPP Everywhere ;-) The reason is simple: I do not have an IPP Everywhere printer. I have only a traditional PostScript color laser USB printer. |
EDIT: updated the first comment to reflect the discussion. |
@michaelrsweet Most desktop application work with libcups for printing, only very old apps call
GTK+ and Qt toolkits are also among them. UPD. Some of applications from the list above may not really use libcups directly but can be accidently overlinked with it, I think. |
Centralizing managing printers via text configs seems to be a good idea, sssd could be taught to get and apply them from FreeIPA domain, for example. But it seems to be a bit far from real life. Usually only a few PCs require access to one printer, trying to centralize management of it will be a big overkill in many cases. (and most printers are some crap not ready for IPP without PPDs by the way, CUPS 3.0 will not be usable without support of PPDs either directly or indirectly, most distros simply won't package it in such case, I am pretty sure). If I am not mistaken, currently there is no way to disable automatic discovery of printers by CUPS via mDNS/Avahi. It is possible to off advertizing them, but not discovering. CUPS can discover too many printers in even small corporate environments. CC @sibskull
That sounds useful, there will be less crap being automatically advertized via mDNS, for example. |
Hi @mikhailnov ,
unfortunately working with libcups doesn't automatically mean working with modern CUPS API, which is needed for proper temp queues support and which has been the issue causing most people to install their printers.
It seems there is a misunderstanding - the printer profiles aren't about centralizing managing printers, but about making printers, which aren't in the local network (which is the mDNS default limitation), available in a print dialog without requiring them to be installed permanently.
Most printers made after 2010 are capable of IPP Everywhere, so they don't need a PPD for working properly.
For old devices which doesn't support IPP Everywhere, OpenPrinting's already provided a retro-fitting printer applications for several PDLs and created manual how to create a new printer application - see OpenPrinting/cups-sharing#4 . The printer application's mechanism can be used for devices which provide more specialized settings than IPP Everywhere has to offer - Gutenprint people are working on such app.
Hmm, you're right - I thought there is the same directive as in cups-browsed, |
08.11.2021 10:27, zdohnal пишет:
Hi @mikhailnov <https://github.com/mikhailnov> ,
@michaelrsweet <https://github.com/michaelrsweet> Most desktop application work with libcups for printing, only very old apps call |lp| or other similar tools directly. Have a look at which applications from a ditro repo + proprietary repo of Google Chrome depens from libcups:
unfortunately working with libcups doesn't automatically mean working with modern CUPS API, which is needed for proper temp queues support and which has been the issue causing most people to install their printers.
Centralizing managing printers via text configs seems to be a good idea, sssd could be taught to get and apply them from FreeIPA domain, for example.
It seems there is a misunderstanding - the printer profiles aren't about centralizing managing printers, but about making printers, which aren't in the local network (which is the mDNS default limitation), available in a print dialog without requiring them to be installed permanently.
Thanks for clarifying. It also helps to manage printers centrally.
(and most printers are some crap not ready for IPP without PPDs by the way, CUPS 3.0 will not be usable without support of PPDs either directly or indirectly, most distros simply won't package it in such case, I am pretty sure).
Most printers made after 2010 are capable of IPP Everywhere, so they don't need a PPD for working properly.
I have Kyocera FS-1060DN bought in 2017. It requires a custom CUPS backend rastertokpsl and does not understand standard formats like PDF, PCL etc. I think it does not support IPP.
Also there is quite a \lot of pre-2010 printers in use. Printers of those years are usually made better then most of modern crap like printers requiring a subscription or where a new torner costs as a new printer.
Many printers being sold require proprietary "drivers", sometimes those are convertors to an internal proprietary format, some times just PPDs with custom settings and calling custom scripts which do hackery with utilities like gs(1) preparing the input for the printer.
|
Unfortunately it doesn't depend on when you've bought it, but when the model was started to sell - your model (according dates on its manual) is from 2012.
You can check whether the device supports IPP Everywhere/AirPrint. If you have the device connected by USB, look for 7/1/4 interface in Brian documented nicely all driverless options here https://wiki.debian.org/CUPSDriverlessPrinting .
That's what a printer application technology is for. |
OK, proposal:
Profile format is basically as previously proposed:
|
I beleive it is important to allow to block per-user profiles or specific values inside them. For secirty reasons for example.Message ID: ***@***.***>
|
@mikhailnov What security reasons? |
WRT controlling whether profiles and/or mDNS are used on the client side, I'm not sure whether that is necessary or useful. I wouldn't mind adding filtering support (printer-type and printer-location has been available since the CUPS 1.x days in different ways, printer-geo-location could be added as well) so that enterprise networks with large numbers of printers could be whittled down a bit. Some possibilities for filtering directives (in client.conf and the profile files):
|
Implementing in "profiles" branch... |
OK, so after some prototyping and performance analysis, it seems like this should all go in the cups-local service because of the time it may take to build a list of available profile printers. Similar to how the current cups-browsed operates, cups-locald will need to monitor for network and filesystem changes so that it can update the list of available printers only when needed, and in the background so as not to disturb applications. The cups-locald service can also handle naming conflicts in a centralized way. Moving to cups-local project. |
This issue is a placeholder for implementing printer profiles, which are needed for the case:
The idea of printer profiles was introduced by Mike Sweet during email communication within OpenPrinting group and distro maintainers and presented during PWG F2F meetups.
Set of features provided by printer profiles:
Tasks:
cupsEnumDests()
CUPS library function (idea:cupsEnumDests()
will check/etc/cups/profiles/
and if there are some, add them to the output - this will show profile queues in print dialogs, which use cupsEnumDests())I will try to implement this feature in meantime, but any other help is welcomed.
@michaelrsweet WDYT? Did I forget about something in tasks or do you have any recommendation what to add?
The text was updated successfully, but these errors were encountered: