From: Dustin Kirkland Date: Mon, 10 Nov 2008 23:42:14 +0000 (+0100) Subject: make the update-motd process very nice, when not doing a --force run X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=611027a8adc958aaa87c3a97dfce5d07a5b51c7e;p=update-motd.git make the update-motd process very nice, when not doing a --force run --- diff --git a/update-motd b/update-motd index 31a34fb..47ad99f 100755 --- a/update-motd +++ b/update-motd @@ -110,6 +110,12 @@ fi # Make sure we clean up the motd.new lock file if we exit for any reason trap "rm -f $NEW 2>/dev/null || true" EXIT HUP INT QUIT TERM +if [ "$FORCE" != "1" ]; then + # Be *really* nice, if we're running in the background (not forced) + renice 10 $$ >/dev/null + ionice -c2 -n7 -p $$ >/dev/null +fi + # Start with the motd header # This is identical to the motd-building code used in # /etc/init.d/bootmisc.sh