Linux Setting nice level of Kodi on Ubuntu 15.04
#1
I am currently starting Kodi 15.2 after autologin by starting the xserver.

Code:
main@htpc:~$ cat .bash_profile
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
    startx -- -bs
fi

Code:
main@htpc:~$ cat .xinitrc
nice -n -20 kodi

But for some reason, kodi doesn't take the nice level it should, because

Code:
main@htpc:~$ ps -elf | grep kodi
0 S main      1823  1822  0  80   0 -  1118 wait   00:52 tty1     00:00:00 /bin/sh /usr/bin/kodi
0 R main      1825  1823 32  80   0 - 833132 -     00:52 tty1     03:57:31 /usr/lib/kodi/kodi.bin

shows a nice level of 0 (8th column of the output of "ps -elf"). Any ideas what I am doing wrong? Has anybody succeeded in changing the nice level?

Thanks!
Reply
#2
might be a permission issue?
setting the nice level requires root privileges i think.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Ah, thanks, I read somewhere else that only root can set nice levels lower than zero.
Reply
#4
Thanks to ronie's help, I figured out that it was the sudo issue. A fix would be to call nice with sudo, making

Code:
main@htpc:~$ cat .xinitrc
sudo nice -n -15 sudo -u $USER kodi

But this would ask for my sudo password in .xinit, therefore do a "sudo visudo", and add

Code:
%sudo   ALL = (ALL) NOPASSWD: /usr/bin/nice,/usr/bin/renice

at the end of the file, which allows main to run nice and renice without asking for superuser pw.

Thanks, case closed.
Reply
#5
See: /etc/security/limits.conf in http://forum.kodi.tv/showthread.php?tid=231955
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
Setting nice level of Kodi on Ubuntu 15.040