[yocto] Can Yocto build to set up process running priority in service?

ChenQi Qi.Chen at windriver.com
Thu Aug 22 20:34:37 PDT 2019


On 08/23/2019 10:58 AM, JH wrote:
> Thanks ChenQi, can the process priority be set in ExecStart= of the
> xxx.service file?
>
> Thank you.
>
> Kind regards,
>
> - jh

I didn't try it out. But I think the answer is likely to be 'No'.

systemd does not like the old 'nice'. So there's no mechanism integrated 
in systemd.
You can use more modern way of CPUWeight, which makes use cgroup 
mechanism. Check systemd.recource-control(5) for more info.

Best Regards,
Chen Qi

> On 8/23/19, ChenQi <Qi.Chen at windriver.com> wrote:
>> On 08/23/2019 05:32 AM, JH wrote:
>>> I have two processes launched from a service unit, how can the Yocto
>>> customer distro to set up high_priority_process?
>>>
>>> ExecStartPre=low_priority_priority
>>> ExecStart=high_priroty_process
>>>
>>> Thank you.
>>>
>>> Kind regards,
>>>
>>> - jh
>>>
>>> On 8/22/19, JH <jupiter.hce at gmail.com> wrote:
>>>> Hi,
>>>>
>>>> How to set up process running priority for services in Yocto build
>>>> using renice or some method?
>>>>
>>>> Thank you.
>>>>
>>>> Kind regards,
>>>>
>>>> - jupiter
>>>>
>> Not sure about your exact needs. But as far as I know, nice value is
>> inherited. You can just set it for the shell that starts a yocto build.
>> If you are using some scripts, the same logic holds.
>>
>> Best Regards,
>>
>> Chen Qi
>>
>>



More information about the yocto mailing list