[cups.general] Passing extra information from environmenttobackend?

Erik Forsberg forsberg at cendio.se
Fri Oct 19 04:55:47 PDT 2007


> >> One could also store the "myoption=whatever" setting in one of
> >>
> >>   /etc/cups/lpoptions
> >>   ~/.cups/lpoptions
> >>
> >> (depending on: is the setting user-specific or not?) and rely on it
> >> being picked up by the lp/lpr commands automatically.
> > 
> > Interesting, but will not solve the problem - I might have explained
> > badly, but as the same user may have several sessions, on the same
> > machine, and I want to distingush between sessions in my backend,
> 
> BTW, what do you mean with *MY* backend?

> 
> If it is a custom backend, over whose code you have full control,

It is.

> you
> can make it read a commandline option that is passed via the print
> command. Say "my_session_id=username at session_number". Your backend
> just needs to evaluate what it sees as $5 (if backend is a shell
> script) or more generally, argv[5]

Sure. The problem is that I can't expect my users to pass this
commandline options when they print, especially not since most print
jobs will be generated by software that uses libcups to print, not the
'lp' or 'lpr' commands. Neither KDE's printer library, Gnome's printer
library nor Openoffice run 'lp' or 'lpr' to submit their print jobs -
they all call functions inside libcups to do that. 

At least in my understanding, please correct me if I'm wrong. 

There is very little use of commandline printing in this kind of
environment. 

> That's what Johannes already pointed out.
> 
> > setting lpoptions in ~/.cups/lpoptions will not help, as these will
> > be used by all sessions.
> > 
> > If there were an environment variable for lpoptions being picked up
> > by libcups, that would help, because this variable could be set
> > differently in different sessions. 
> 
> Why does it *need* to be an env var, why can't it be a commandline
> option?

See above. An environment variable read by libcups could be set at
start of session. All started programs would then inherit it, allowing
libcups to read it regardless of application submitting the print job.

Regards,
\EF
-- 
Erik Forsberg                OpenSource-based Thin Client Technology
Systems Analyst/Developer    Phone: +46-13-21 46 00    
Cendio AB    	             Web: http://www.cendio.com

ThinLinc User Group 2007 Höstkonferens --- 15-16 november, Linköping.
Program och anmälan: http://www.thinlincusergroup.se/aktiviteter




More information about the cups mailing list