Recent

Author Topic: TProcess.Execute/Terminate with root privileges for child process  (Read 1583 times)

sporer@sctn.de

  • New Member
  • *
  • Posts: 24
I'am launching an external process on a Raspberry PI (debian jessie) with TProcess.
This external process is attempting to set it's own priority via the Linux scheduler to a value of 80.
When I configure it in TProcess.CommandLine without "sudo" (/home/pi/ext_process) the scheduler refuses to increase the PR value; I can execute the external process with PR=20 and terminate it at any time, as it is supposed to be.
On the other side, when I configure the CommandLine with "sudo" (sudo /home/pi/ext_process) the scheduler increases the priority to 80, but then I cannot terminate it any more (TProcess.Terminate).
And this is even the case, when I start the parent process (sudo /home/pi/parent) with root privileges.
Does anyone have an idea how to resolve this?

Thanks in advance

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: TProcess.Execute/Terminate with root privileges for child process
« Reply #1 on: June 17, 2019, 03:08:01 pm »
It doesn't make sense that an ordinary user would be able to terminate root processes. So without special software like a special sudo this is hard, and beyond the ability of normal compilers.

You need kernel cooperation for that.

bylaardt

  • Sr. Member
  • ****
  • Posts: 309
Re: TProcess.Execute/Terminate with root privileges for child process
« Reply #2 on: June 17, 2019, 03:11:21 pm »
Does anyone have an idea how to resolve this?
Run your application as root  :D

sporer@sctn.de

  • New Member
  • *
  • Posts: 24
Re: TProcess.Execute/Terminate with root privileges for child process
« Reply #3 on: June 17, 2019, 03:17:45 pm »
by bylaardt: Run your application as root

Yes I was also trying this. The result is the same.

sporer@sctn.de

  • New Member
  • *
  • Posts: 24
Re: TProcess.Execute/Terminate with root privileges for child process
« Reply #4 on: June 17, 2019, 03:52:00 pm »
It doesn't make sense that an ordinary user would be able to terminate root processes. So without special software like a special sudo this is hard, and beyond the ability of normal compilers.

You need kernel cooperation for that.

Ok, understood.
I will just manage with PR=20. Obviously there is no perceptible difference (latency) with PR=20.
(The external process is streaming VoIP, the application is performing the signalling protocol that controls the RTP stream)

 

TinyPortal © 2005-2018