[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:       Josef Weidendorfer <Josef.Weidendorfer () gmx ! de>
Date:       2002-02-26 9:36:05
[Download RAW message or body]

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.

Perhaps this helps ?
Josef

On Monday 25 February 2002 23:18, David Faure wrote:
> On Friday 15 February 2002 20:42, Matthias Welwarsky wrote:
> > On Friday 15 February 2002 19:32, Rik Hemsley wrote:
> > > #if Stephan Kulow
...
> > > setsid(2), I think.
> >
> > setpgid(2) is maybe better, because the screensaver is no session leader.
> > If the screensaver should not die when kdesktop dies, move it out of the
> > process group of kdesktop. if you open a new session for the screensaver,
> > it will probably refuse to die when the real session leader (xsession) is
> > killed...
>
> I tried that but it doesn't appear to work, both go away when kdesktop is
> killed. Help!

Hi David,


>
> Index: kdesktop/lockeng.cc
> ===================================================================
> RCS file: /home/kde/kdebase/kdesktop/lockeng.cc,v
> retrieving revision 1.49
> diff -u -p -r1.49 lockeng.cc
> --- kdesktop/lockeng.cc 2002/01/23 02:23:34     1.49
> +++ kdesktop/lockeng.cc 2002/02/25 22:10:43
> @@ -617,6 +617,9 @@ bool SaverEngine::startHack()
>
>          if (mHackProc.start() == true)
>          {
> +            // Dissociate from kdesktop, so that if kdesktop dies the lock
> remains +            kdDebug() << " Calling setpgid(" << mHackProc.getPid()
> << ",1)" << endl; +            setpgid(mHackProc.getPid(), 1);
>  #ifdef HAVE_SETPRIORITY
>              setpriority(PRIO_PROCESS, mHackProc.getPid(), mPriority);
>  #endif

-- 
--
Josef Weidendorfer
[prev in list] [next in list] [prev in thread] [next in thread] 

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