From kde-core-devel Thu Feb 28 20:06:00 2002 From: Waldo Bastian Date: Thu, 28 Feb 2002 20:06:00 +0000 To: kde-core-devel Subject: Re: Bug#38142: wrong wallpaper list kills xlock (fwd) X-MARC-Message: https://marc.info/?l=kde-core-devel&m=101492679323234 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, t= he > > 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 KProces= s :( > 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 w= ith > 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=20 don't know if you will still get the SIGCHLD though. I doubt it. If you k= eep=20 a pipe open with the daemon, the daemon will be able to tell you its PID,= so=20 that you can kill it. And you will be able to detect that the daemon died= =20 because you can detect when the pipe closes. Cheers, Waldo --=20 Advanced technology only happens when people take a basic idea and add to= it. -- Bob Bemer