[cups-devel] how to get MaxJobs value programmatically

Michael Sweet msweet at apple.com
Wed Mar 7 12:18:57 PST 2018


Prasanta,

What are you trying to do?  MaxJobs is only one of several configuration settings that may limit whether a new job can be submitted (MaxJobsPerPrinter and MaxJobsPerUser exist, the value of the printer-is-accepting-jobs attribute for a given printer, and the quota settings for the printer also are checked), so unless you are writing an administrative utility you probably don't want to make any decisions based on settings in cupsd.conf.

As for ways to get this information, ordinary users have no way to obtain it as they will not have permission to read the cupsd.conf file.  The cupsAdminGetServerSettings API in libcups allows an administrative application (run and authenticated by an administrative user as necessary) to query whether the default value has been overridden, however you'll have to make an assumption about the default value if no MaxJobs is present, and that value has changed over the years...  And as noted previously, MaxJobs is only one of many variables...


> On Feb 28, 2018, at 12:43 AM, My Sadhukhan <psadhukhan at gmail.com> wrote:
> 
> Hi,
> 
> I see in
> */etc/cups/cupsd.conf we haveMaxJobs number*
> *    Specifies the maximum number of simultaneous jobs that are allowed.
> Set *
> 
> 
> *to "0" to allow an unlimited number of jobs. The default is "500".*
> 
> *Is there any way we can get this number programmatically? *
> 
> 
> *I do not see this in "env" and so I think we cannot get this from
> getenv()?*
> 
> *Regards*
> 
> *Prasanta*
> _______________________________________________
> cups-devel mailing list
> cups-devel at cups.org
> https://lists.cups.org/mailman/listinfo/cups-devel

_________________________________________________________
Michael Sweet, Senior Printing System Engineer



More information about the cups-devel mailing list