:: Re: [Dng] printing (was Re: Readine…
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Dr. Nikolaus Klepp
Ημερομηνία:  
Προς: dng
Αντικείμενο: Re: [Dng] printing (was Re: Readiness notification)
Am Sonntag, 14. Juni 2015 schrieb Laurent Bercot:
> On 14/06/2015 15:29, Nikolaus Klepp wrote:
> > And I thought the historic solution would be to give your web printing service an id higher than cups, eg.:
> >
> > /etc/rc*/S04cups
> > /etc/rc*/S99awsomewebprinter
> >
> > Together with the nightmare from unix museum (aka fork when ready) it simply works.
>
> No, it doesn't.
> The S04cups script will start cups, spawn the process, but exit before the
> service is ready; your sysv-rc mechanism will only see S04cups die, think
> it's okay, and start S99awsomewebprinter. There is a race condition and
> the web printing service may be started too early.
> Unless cups implements readiness notification, and S04cups waits for this
> notification before returning. Then S99awsomewebprinter will only be
> started once the cups service is *actually* running.
>
> It's not a theoretical problem. It's a very real one. Some daemons take
> ages to get ready after they've been started, their needed prep work is
> longer than it takes for a shell script to exit and another one to be
> spawned, and the race condition is real.
>
> Again, depending on your needs, you may not have experienced it, or you may
> not care. That's fine. But it's still there.
>


Hm, that's not the point. The S04cups you takt about does "fork befor ready", not "fork after ready". If it's implemented as "fork befor ready", then it's most likely a bug, 'cause that's the whole point of the order of the startup scripts. "fork before ready" would be equal to "start all startup scripts in parallel" - which does not work.

Nik



--
Please do not email me anything that you are not comfortable also sharing with the NSA.

Mag. Dr. Nikolaus Klepp
Einnehmerstraße 14
A-4810 Gmunden
Tel.: +43 650 82 11 724
email: office@???
       dr.klepp@???