Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22686 - start-stop-daemon in baselayout doesn't allow altered nicelevel
Summary: start-stop-daemon in baselayout doesn't allow altered nicelevel
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2003-06-12 10:51 UTC by Daniel Steinberger
Modified: 2004-05-07 15:31 UTC (History)
1 user (show)

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 Daniel Steinberger 2003-06-12 10:51:13 UTC
when trying to start a daemon with altered priority like "start-stop-daemon
--start --quiet --nicelevel -1 --exec /usr/sbin/smbd", an error "Unable to alter
nice level by -1: Success" is thrown instead of working properly. it has been
discussed in the forums
(http://forums.gentoo.org/viewtopic.php?t=29896&highlight=startstopdaemon) and
after looking at this a little further, i found that in the linux nice() manpage
you find a note that the syscall now returns the new nicelevel on success.
before glibc 2.2.4 not the new nicevalue was returned, but 0. so it's suggested
to use setpriority() and getpriority() syscalls instead.

i've been reading the debian lists, and the problem is known there too, and
patched already are pending. the subject is mentioned here for example:
http://lists.debian.org/debian-dpkg/2002/debian-dpkg-200204/msg00017.html

as said in the forums, this problem can easily be worked around, but it's
irritating and i think it would be good to fix it, if possible.

Reproducible: Always
Steps to Reproduce:
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-09-14 09:42:54 UTC
Works here.  And with glibc-2.3.2, the man page say:

------------------------
RETURN VALUE
       On success, zero is returned.  On error, -1 is returned, and errno is set appropriately.
 
------------------------

------------------------------------------
gateway root # start-stop-daemon --start --quiet --nicelevel -1 --exec /usr/sbin/smbd && echo
yes
gateway root #
Comment 2 Lisa Seelye (RETIRED) gentoo-dev 2003-09-14 11:08:02 UTC
(oops. wrong issue. dont mind me)
Comment 3 Aron Griffis (RETIRED) gentoo-dev 2004-05-03 17:43:11 UTC
The man-page is wrong...

    #include <unistd.h>
    int main() {
        printf("%d", nice(10));
    }

    $ ./t 
    10

Apparently we get our start-stop-daemon from debian.  I'll look into it.  Thanks for the bug report.

Comment 4 Aron Griffis (RETIRED) gentoo-dev 2004-05-03 19:38:08 UTC
committed to rc-scripts cvs
Comment 5 Aron Griffis (RETIRED) gentoo-dev 2004-05-07 15:31:11 UTC
okay, baselayout-1.9.0 is in portage