Recent

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

sporer@sctn.de

  • New Member
  • *
  • Posts: 20
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7458
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: 303
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: 20
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: 20
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)