coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] nice: add -a arg to set absolute niceness


From: Pádraig Brady
Subject: Re: [PATCH] nice: add -a arg to set absolute niceness
Date: Sat, 22 Aug 2020 11:37:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Thunderbird/80.0

On 22/08/2020 02:43, Kevin Mark wrote:
On Fri, Aug 21, 2020 at 9:14 AM Pádraig Brady wrote:
I'm not sure the new option is worth this simplification.

Thanks for taking a look. I agree that the small shell one-liner this
patch can replace is not particularly motivating, but I wanted to
include it to make it clear what feature this patch was adding. The
good news is that this patch should be strictly additive and I was not
able to find an instance where it introduced a backcompat issue.

My motivation for this patch originates from the need to set a
specific/absolute niceness value in an environment where the shell
alternative I mentioned is unavailable. I'm using SDDM to launch Xorg,
and I'd like for Xorg to be launched with a niceness of -4 regardless
of SDDM's niceness, which should be 0 but I don't want to rely on
that. SDDM, via sddm.conf, allows me to configure the path to the Xorg
binary and its arguments, but in this configuration file I do not have
any mechanism to use shell logic. I can only provide a hardcoded
string to a binary. This patch allows me to set the following in my
SDDM config:

[X11]
ServerPath=/usr/local/bin/nice
ServerArguments=-a -4 /usr/bin/Xorg -nolisten tcp

thanks for the concrete example. That helps.
Since this is a bit of an edge case,
would something like this suffice:

  [X11]
  ServerPath=/bin/sh
  ServerArguments=-c 'nice -n $((-4 - $(nice))) /usr/bin/Xorg -nolisten tcp'

You may need to use `env -S` if ServerArguments isn't split as required.

cheers,
Pádraig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]