This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to make kmail execute some program in background?

Tags: None
(comma "," separated)
User avatar
pavel
Registered Member
Posts
134
Karma
1
OS
Now, I have mail filter, that starts java program. This program runs up to 10 seconds and takes a lot of CPU time. While the program is running, the whole Kontact application does not respond on user interface actions.

I want to execute the program in background with increased niceness. Now my commend line to execute from KMail looks like this
Code: Select all
pushd /home/pavel/apps/SynchronizeToWpkg; nice java -jar dist/SynchronizeToWpkg.jar --wpkg-file-pattern=file:///mnt/tesla_wpkg/wpkg-client-results/.*-all.xml --packages-dir=file:///mnt/tesla_wpkg/packages/; popd &

But Kontact is still frozen while the program is running. So... how can I detatch my program from KMail or execute it in seperate thread?


pavel, proud to be a member of KDE forums since 2008-Dec.
User avatar
anda_skoa
KDE Developer
Posts
783
Karma
4
OS
Maybe the program can be persuaded to work like Spamasssing, i.e. as a separate service where KMail only invokes a small helper program that then communicates with the service?

Cheers,
_


anda_skoa, proud to be a member of KDE forums since 2008-Oct.
User avatar
pavel
Registered Member
Posts
134
Karma
1
OS
anda_skoa wrote:...i.e. as a separate service where KMail only invokes a small helper program that then communicates with the service?

My program is simple console program. It should not work like a service (daemon).


pavel, proud to be a member of KDE forums since 2008-Dec.
User avatar
anda_skoa
KDE Developer
Posts
783
Karma
4
OS
Hmm, but you are already running it like a service (in the background), just not communicating with it like that.

Anyway, while I can only guess I think KMail already runs the external program in a separate process, but maybe it is waiting for its output and the program is not delivering it?

Cheers,
_


anda_skoa, proud to be a member of KDE forums since 2008-Oct.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], Google [Bot], lockheed, Yahoo [Bot]