Bug 13030 - remove server priorities less than 0 for Unix builds
: remove server priorities less than 0 for Unix builds
Status: NEW
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 7.3.3
: PC Ubuntu Linux
: P3 normal (vote)
: 8.0.0
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-24 00:52 UTC by Th. Kristensen
Modified: 2009-07-29 14:59 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Th. Kristensen 2009-07-24 00:52:23 UTC
Version: 7.3.3 - 27044 @ Mon Jun 15 15:12:32 PDT 2009
Hostname: ubsrv1
Server IP Address: 192.168.1.4
Server HTTP Port Number: 9000
Operating system: Debian - EN - utf8
Platform Architecture: i686-linux
Perl Version: 5.8.8 - i486-linux-gnu-thread-multi
MySQL Version: 5.0.51a-3ubuntu5.4
Total Players Recognized: 1

Ubuntu Linux 8.04 LTS (Linux ubsrv1 2.6.24-24-server)

Squeezecenter Server Priority is set and saved in preferences. But the actual nicevalue is not applied to application processes even when restarting server. It stays default 0.

The Scanner Priority works fine with the correct nicevalue set in preferences.

It's a standard installation without modifications and no plugins installed.

Regards Thomas
Comment 1 Chris Owens 2009-07-27 09:32:53 UTC
top will show you the priority.  Ross to reproduce.
Comment 2 Ross Levine 2009-07-27 15:26:02 UTC
Easily reproduced, under server settings - advanced - performance there are switches to set the server and scanner priority. Setting these doesn't seem to make any difference when compared to top, even after restarting the system or SC as Th points out. 

I'm not sure about the scanner process, I'm guessing its just called perl. However the process squeezecenter-s (presumably squeezecenter-server) still shows a PR of 20 and NI of 0, despite my changes to -15. The perl process also shows up with PR 20 NI 0.
Comment 3 Andy Grundman 2009-07-27 16:22:53 UTC
Did you try setting it to a positive nice value?  You cannot set to < 0 without being root.
Comment 4 Ross Levine 2009-07-27 17:00:19 UTC
Thanks Andy! Selecting a positive number works, sort of. I set priority 12 in SC UI, top shows NI 12 but PR 32?! This remains true after restarting SC and the system. 

We should probably remove the negative options from the UI, if they will not work. Should I file a separate bug, or reword this one?
Comment 5 Andy Grundman 2009-07-27 17:59:37 UTC
OK, so the real bug here is that priorities less than 0 should not be shown on a Unix OS if not root.
Comment 6 Ross Levine 2009-07-27 18:08:10 UTC
Thanks again Andy.
Comment 7 Th. Kristensen 2009-07-28 00:46:00 UTC
How obvious. SC is running as a unprivileged user and has no rights decreasing the nice level. So you should be careful even showing this option at all, because if you set it to high you are not able to decrease it again (without restart). 

However it should be possible to increase the priority within the startscript /etc/init.d/squeezecenter as it is initiated by root.

I managed to increase the priority by adding the following to the line:
start-stop-daemon --start --quiet --nicelevel -8\       # <----
                --chuid $SLIMUSER \
                --pidfile $PIDFILE \
                --exec $DAEMON_SAFE \
                --background \
                --make-pidfile \
                -- \
                $DAEMON \
                --prefsdir $PREFSDIR \
                --logdir $LOGDIR \
                --cachedir $CACHEDIR \
                --charset=$CHARSET \
                $SLIMOPTIONS

Thank you.
Comment 8 Andy Grundman 2009-07-29 14:59:35 UTC
Moving 7.4 bugs to 8.0.