Fork in CUPS filter

Michael Sweet mike at easysw.com
Tue Feb 22 07:38:55 PST 2005


Ralph Majer wrote:
> Hi
> 
> i've written a small CUPS Filter in C++ for some printjob statistics.
> In this filter I'm forking away because for larger printjobs it takes a lot of time to process them. So the parent process finishes very fast and CUPS should go on with the filter chain.
> 
> But I've noticed that CUPS is also waiting until the child process of the filter is finished.
> Is it not possible just to fork away??
> I found nothing about it in the documentation.

You need to detach your background process from the parent; typically
this means closing stdin, stdout, and stderr and calling setsid().

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Document Software          http://www.easysw.com




More information about the cups mailing list