[geeks] Staring apache with "nice"?

Jay Monkman jtm-geeks at smoothsmoothie.com
Tue Dec 5 16:02:28 CST 2006


On Tue, Dec 05, 2006 at 01:06:32PM -0600, Mike Hebel wrote:
> Thus spake Geoffrey S. Mendelson:
> > On Tue, Dec 05, 2006 at 12:46:20PM -0600, Mike Hebel wrote:
> >> Trying to keep apache from killing the Cobalt Qube 2700WG I have at home
> >> but I can't seem to find where to add the "nice" command.
> >>
> >> Anybody got a good suggestion?  This is on Debian Cobalt btw.
> >
> > In /etc/init.d/apache to be exact.
> >
> > 	case "$1" in
> > 	  start)
> > 	    should_start
> > 	    test_config
> > 	    echo -n "Starting web server: $NAME"
> > 	    $ENV $SSD --start --pidfile $PIDFILE --exec $DAEMON > /dev/null
> > 	    ;;
> >
> > Somewhere on the last line, I assume.
> 
> I tried adding it there and I get variable errors.

If $SSD is 'start-stop-daemon' and if it's a recent version, you can
give it the '-N' or '--nicelevel' argument with the desired niceness.

At least that's what my manpage says (version 1.13.22)


If that doesn't work, this might work:
   $ENV $SSD --start --pidfile $PIDFILE --exec nice -- \
	-n <nice level> $DAEMON > /dev/null



More information about the geeks mailing list