I know that niceness values are inherited from the niceness value of the parent process, but can I globally change the default niceness value for a particular user (myself).
In this case I have a small convenience server in mind, which is exclusively accessed via
ssh. So, I think I could change my default shell from
/etc/bash5 is this script:
#!/bin/sh nice -n 5 /bin/bash #file privileges: root:root 755
This strikes me as a terrible hack and error prone. There must be a better way.
I'm mostly interested in general solutions, that would also apply to a desktop/laptop system.
Edit: I tried the suggested
limits.conf change, but it doesn't work as expected:
root@server# addgroup nice root@server# adduser myself nice root@server# echo '@nice soft nice 5' >> /etc/security/limits.conf
Then, from my client machine, I say
myself@client$ ssh server myself@server$ sleep 1h & myself@server$ htop
sleep process has an initial niceness value of
0, but if I change the value with
F8 to 19 and then try to reduce it again with
F7 it stops at
Instead of using the
nice item in
limits.conf, you actually have to use
priority although it is counter-intuitive.
@nice soft priority 5