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:
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 #
(oops. wrong issue. dont mind me)
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.
committed to rc-scripts cvs
okay, baselayout-1.9.0 is in portage