Bug 201391 - daemon() macro doesn't normalize the nicelevel
Summary: daemon() macro doesn't normalize the nicelevel
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2006-08-04 19:07 UTC by Bill Rugolsky, Jr.
Modified: 2014-03-17 03:01 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2007-04-17 00:02:53 UTC

Attachments (Terms of Use)
patch to set the nicelevel explicitly (870 bytes, patch)
2006-08-04 19:07 UTC, Bill Rugolsky, Jr.
no flags Details | Diff

Description Bill Rugolsky, Jr. 2006-08-04 19:07:23 UTC
Description of problem:

When upgrading packages on a production server, we find it desirable to "nice"
the update process.  Unfortunately, this interacts poorly with the post-install
restart logic and the initscripts daemon logic.  The attached patch changes
initscripts to treat NICELEVEL and the nicelevel argument to daemon() as
absolute nicelevels, and uses nice to adjust the level accordingly.  It has an
unfortunate dependency on the coreutils /bin/nice SUSv3-compatible extension
which causes nice to return the process nicelevel if a command to execute is
not specified.  

Version-Release number of selected component (if applicable):
initscripts-8.38-1 and earlier.

How reproducible:

Steps to Reproduce:
1. nice rpm -Uvh openssh*.rpm
2. ps -o command,nice -p $(pgrep -x sshd)
Actual results:
COMMAND                      NI
/usr/sbin/sshd               10

Expected results:
COMMAND                      NI
/usr/sbin/sshd                0

Additional info:

Comment 1 Bill Rugolsky, Jr. 2006-08-04 19:07:24 UTC
Created attachment 133656 [details]
patch to set the nicelevel explicitly

Comment 2 Bill Nottingham 2007-04-17 00:02:53 UTC
Unfortunately, setting it as absolutes changes the existing (documented)
behavior, so this can't be done as-is.

Note You need to log in before you can comment on or make changes to this bug.