issues with "nice"ness when named or named-xfer run as non-root

Scott Bertilson scott at nts.umn.edu
Thu Jan 13 20:51:52 UTC 2000


  Have been using "named-xfer" from a script in the process
of migrating our DNS from flat files into the Lucent QIP
package.  In the process of trying to diagnose some
problems I have run it using a non-root userid and have
been bitten by the fact that "named-xfer" attempts to
get itself back to "normal" priority:

#ifdef RENICE
        nice(-40);      /* this is the recommended procedure to        */
        nice(20);       /*   reset the priority of the current process */
        nice(0);        /*   to "normal" (== 0) - see nice(3)          */
#endif

When running as non-root, the "nice(-40)" fails, but the
"nice(20)" succeeds, leaving the process at a nice level
of 19.  This is true on both SunOS 4.1.4 and Solaris 2.6.
It is probably only noticeable on a machine which is short
of idle CPU time.

I would expect the same problem would exist for
anyone running "named" as a non-root UID.

  I wonder if the code shouldn't check for errors after
the "nice(-40)" and avoid doing the other "nice" calls
if that didn't succeed.  SunOS sees "Permission denied"
and Solaris sees "Not owner".
  I know this isn't the "recommended procedure", but it
seems prudent.  Thoughts?
					Scott



More information about the bind-users mailing list