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

List:       kde-devel
Subject:    Re: Controlling non-KDE processes
From:       Michael Goffioul <goffioul () imec ! be>
Date:       2002-04-30 16:26:04
[Download RAW message or body]

> Hi!
> I need to check if a process is already running, if not it has to be
> restarted.
> It is not a KDE-Application.
> And the processes don't have a window (console apps or daemons).
> Is there a way to easily check if such a process (check using the command with
> that it was called) exists?
> And repeat this check every 10 seconds or so?
> 
> I'm using KProcess at the moment, but the problem is, that the process which I
> want to control could be started outside my application.
> And as far as I know, I can't do the things I described above with KProcess.

One possible way to check the existence of a process is the send a
null signal to it, see man pages of signal. The problem is that you
need to the PID. Another way is to scan /proc filesystem, but it's
Linux specific.

Michael.

-- 
------------------------------------------------------------------
Michael Goffioul		IMEC-DESICS-MIRA
e-mail: goffioul@imec.be	(Mixed-Signal and RF Applications)
Tel:    +32/16/28-8510		Kapeldreef, 75
Fax:    +32/16/28-1515		3001 HEVERLEE, BELGIUM
------------------------------------------------------------------
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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