Recent

Author Topic: how do I terminate a pkexec tprocess?  (Read 2635 times)

Michael Collier

  • Sr. Member
  • ****
  • Posts: 301
how do I terminate a pkexec tprocess?
« on: July 27, 2015, 01:49:21 pm »
I tried using pkexec within tprocess to execute a program that runs in an infinite loop, and when I try to terminate the process i.e. Proc.terminate(-1) it doesn't seem to stop.

If I leave out the pkexec then I can terminate. I'm new to pkexec, have I missed something? I'm guessing that I don't have enough privilege to terminate?

I can kill the process from a terminal using sudo killall <application_name>, so I could use another tprocess object to close my first tprocess (I guess..), but this is getting messy..??

Michael Collier

  • Sr. Member
  • ****
  • Posts: 301
Re: how do I terminate a pkexec tprocess?
« Reply #1 on: July 27, 2015, 02:12:09 pm »
.. this seems to help,

pkexec -u <my_username> <my_sudo_application>

Basile B.

  • Guest
Re: how do I terminate a pkexec tprocess?
« Reply #2 on: July 27, 2015, 02:36:39 pm »
Try TAsyncProcess. For example if you have the GUI blocked during execution.
You can try to kill the process in the event OnReadData() or elsewhere too.

 

TinyPortal © 2005-2018