:: Re: [Dng] printing (was Re: Readine…
Inizio della pagina
Delete this message
Reply to this message
Autore: KatolaZ
Data:  
To: Laurent Bercot
CC: dng
Oggetto: Re: [Dng] printing (was Re: Readiness notification)
On Sun, Jun 14, 2015 at 03:50:06PM +0200, Laurent Bercot wrote:
> 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.



I am sorry but you simply don't get rid of race conditions by
signalling that the daemon is ready. If the daemon dies or hangs for
whatever reason, you will still have a problem, since you thought the
service was up and running while it is not any more....



--
[ Enzo Nicosia aka KatolaZ --- GLUG Catania -- Freaknet Medialab ]
[ me [at] katolaz.homeunix.net -- http://katolaz.homeunix.net -- ]
[ GNU/Linux User:#325780/ICQ UIN: #258332181/GPG key ID 0B5F062F ]
[ Fingerprint: 8E59 D6AA 445E FDB4 A153 3D5A 5F20 B3AE 0B5F 062F ]