[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Bug#38142: wrong wallpaper list kills xlock (fwd)
From:       Waldo Bastian <bastian () kde ! org>
Date:       2002-02-28 20:06:00
[Download RAW message or body]

On Wednesday 27 February 2002 03:07 pm, David Faure wrote:
> On Tuesday 26 February 2002 10:36, Josef Weidendorfer wrote:
> > Hi,
> >
> > I don't know anything about the SaverEngine, but a good way to start
> > a daemon is to fork 2 times, and let the first fork exit. This way, the
> > daemon gets init (PID 1) as parent, and has no connection to the orig
> > process.
>
> Thanks for the hint... but I don't see how to combine this with KProcess :(
> lockeng.cc uses a KProcess for the screensaver process, to be able to
> know when it exited (although... SaverEngine::hackExited() doesn't make
> much sense to me). .. and also to be able to terminate the screensaver by
> force (stopSaver(), calls stopHack()). Not sure how to do all of this with
> 2 forks. Waldo, you're the expert about such stuff, aren't you ?  /me
> trying flattery ;)

You will have to communicate the PID back to the parent process somehow. I 
don't know if you will still get the SIGCHLD though. I doubt it. If you keep 
a pipe open with the daemon, the daemon will be able to tell you its PID, so 
that you can kill it. And you will be able to detect that the daemon died 
because you can detect when the pipe closes.

Cheers,
Waldo

-- 
Advanced technology only happens when people take a basic idea and add to it.
 -- Bob Bemer

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic