]> git.etc.gen.nz Git - update-motd.git/commitdiff
make the update-motd process very nice, when not doing a --force run
authorDustin Kirkland <kirkland@canonical.com>
Mon, 10 Nov 2008 23:42:14 +0000 (00:42 +0100)
committerDustin Kirkland <kirkland@canonical.com>
Mon, 10 Nov 2008 23:42:14 +0000 (00:42 +0100)
update-motd

index 31a34fb2870b51a4430107514b0f7036d5ccf9f7..47ad99fa83e0bfa894db94fa3f92c99c97c61d09 100755 (executable)
@@ -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