[cups] Custom backend with fork()
jkillen at allamericanasphalt.com
Wed Apr 29 10:04:10 PDT 2015
Thanks Michael - I think that is exactly what I'm looking for.
To address some of the other responses, I feel I should clarify - in this situation, there is no physical printer device. Lpr is simply used as a transport to get a file to the server and run a program against that file - more like an inetd type service.
From: cups-bounces at cups.org [mailto:cups-bounces at cups.org] On Behalf Of Michael Sweet
Sent: Wednesday, April 29, 2015 5:52 AM
To: The CUPS user discussion list.
Subject: Re: [cups] Custom backend with fork()
You'll need to separate the child from the process group, otherwise the child will hold up the parent from exiting.
"man setpgid" and "man setsid"...
> On Apr 28, 2015, at 4:01 PM, Justin Killen <jkillen at allamericanasphalt.com> wrote:
> I'm trying to emulate a system that passes job control via lpr/lpd. I've got the basics worked out, but I'm getting held up by jobs only running one at a time. Ideally, what should happen is that if 10 jobs are queued, they should all run in parallel. In the legacy system (an AIX box), it was accomplished by the backend script fork()ing, and the parent returning, which caused the print queue entry to be 'complete' and it would go to the next one. I tried this strategy with CUPS, but it doesn't work -the backend script forks and the parent returns, but CUPS still waits for the child PID to complete before moving on to the next item on the queue. Perhaps CUPS is monitoring the entire process tree? Anyway, any ideas or thoughts would be welcomed.
> cups mailing list
> cups at cups.org
Michael Sweet, Senior Printing System Engineer, PWG Chair
cups mailing list
cups at cups.org
More information about the cups