PDA

View Full Version : Detecting running programs in Linux



Kubil
18th December 2007, 12:53
Does anyone know how to detect some/all programs that running in Linux system,
here is the result from ps x for example

bash -ls
knotify [kdeinit]
/bin/bash
/bin/sh /usr/bin/thunderbird
/bin/sh /usr/lib/thunderbird/run-mozilla.sh /usr/lib/thunderbird/thunderbird-bin
/usr/lib/thunderbird/thunderbird-bin -contentLocale US -UILocale en-US
/usr/libexec/gconfd-2 17
assistant
gaim

i want detect e.g thunderbird or containing,
if already running or not directly from qt.
thanks.

marcel
18th December 2007, 12:58
You can find the ps or top sources in the distribution sources. Then you can take the code from there and put it in your Qt application.

Although, I think they are using /proc to get the infos.

Another way is to run ps or top with QProcess and analyze their output.

c_07
19th December 2007, 12:50
This reminds me of a similar thread on a different forum (http://www.qtforum.org/thread.php?threadid=23367) that I saw a while back.
The fourth post down might be helpful.