Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 215286 - Enhancement: generic support for configuring niceness to init scripts
Summary: Enhancement: generic support for configuring niceness to init scripts
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-29 07:55 UTC by Felix Leimbach
Modified: 2008-03-29 15:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Leimbach 2008-03-29 07:55:04 UTC
Many times I find myself re-nice-ing services on server and desktiop boxes after startup.
I.e. I renice the interactive stuff to a higher CPU priority and the background stuff to a lower to achieve greater responsiveness.

How about adding support for that in general, i.e. in every init script?

Since the init scripts support reading config variables from /etc/conf.d/$name_of_init_script it should be easy to support a generic $NICE=[-20 .. 19] variable in /etc/conf.d/$name_of_init_script which does exactly that automatically on service startup.

Those init script's which use start-stop-daemon could add a "--nicelevel $NICE" while the others could just prepend a "/usr/bin/nice -n $NICE".

FWIW /etc/init.d/mysql does that already, although in a more complicated fashion.

We could take that one level further and also add support for ionice on newer kernels. It can enhance the felt system responsiveness a great deal.

This is discussed in the forums too: http://forums.gentoo.org/viewtopic.php?p=5008550#5008550

Reproducible: Always

Steps to Reproduce:
Comment 1 Roy Marples 2008-03-29 09:39:31 UTC
start-stop-daemon in OpenRC already checks the SSD_NICELEVEL env var.
This means you can do this in /etc/conf.d/foo
export SSD_NICELEVEL=19

or globally in /etc/rc.conf
Comment 2 Felix Leimbach 2008-03-29 09:56:29 UTC
That's great news. Unfortunately openRC is still masked and I won't migrate all my servers yet. According to [1] it seems that openRC is supposed to replace the current init scripts in the future.
Does anyone have an update on that entry (dated 11/12/2007) or knows if that is still the current plan?

[1] http://www.tuxmachines.org/node/21902
Comment 3 SpanKY gentoo-dev 2008-03-29 15:24:30 UTC
not worth backporting as we already designed this into openrc