Path: utzoo!utgpu!watserv1!watmath!att!att!linac!uwm.edu!zaphod.mps.ohio-state.edu!samsung!olivea!oliveb!veritas!craig From: craig@veritas.uucp (Craig Harmer) Newsgroups: comp.unix.internals Subject: Re: Cron lowering nice value of jobs run Keywords: ksh background processes Message-ID: <1990Nov28.055412.22357@veritas.uucp> Date: 28 Nov 90 05:54:12 GMT References: <1990Nov20.163139.9997@cscnj> Organization: Veritas Lines: 39 In article <1990Nov20.163139.9997@cscnj> kevin@cscnj (Kevin Walsh) writes: >Does anyone out there know why cron starts up it's subshell(s) at a lower >nice value than cron itself is running at? There also seems to be a difference >in nice value between scripts/processes started via crontab using a cron table >and by "at". The jobs run via the "at" program run with a lower nice value, >and therefore higher priority, than those started from a cron table. Starting >a process in background from a shell script which is run by a cron table seems >to give the highest nice value (to the background process). > >I am curious as to why this is done since it does not seem to provide any real >benefits and certainly no performance advantages in an application which makes >considerable use of a cron table for periodic processing. > >Thanks, Kevin. >-- >--------- >Kevin Walsh Computer Sciences Corporation Piscataway, NJ 08854 >..!rutgers.rutgers.edu!cscnj!kevin apparently cron (in SVR4, at least) nices (see nice(2)) background processes by 2 (by default). cron jobs should be less important then whatever interactive stuff is being done, so this is reasonable. if its a problem, you can always nice the process back up (if you're running as root). another possibility is that you're seeing a "feature" of the ksh (which probably also occurs when ksh is used as a replacement for sh, by invoking it by the name "sh"). ksh nices (see nice(1)) background processes by 4, presumably because they're less interesting than foreground processes. background processes started from shell scripts run via ksh will get nice'd as well. this produced some interesting problems on one system when we were starting the inet daemon from a shell script that was executed by ksh. -- {apple,pyramid,amdahl}!veritas!craig craig@hoser.veritas.com (415) 626-6827 (h) (408) 433-5588 x220 (w) [views expressed above shouldn't be taken as Veritas' views, or your views or even as my views]