Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Sep 2010 01:45:33 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r213181 - head/usr.sbin/watchdogd
Message-ID:  <201009260145.o8Q1jXUk078511@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Sun Sep 26 01:45:33 2010
New Revision: 213181
URL: http://svn.freebsd.org/changeset/base/213181

Log:
  Protect the watchdog daemon against swap OOM killer.  This is similar to
  SVN r199804 which added protection to sshd, cron, syslogd, and inetd.

Modified:
  head/usr.sbin/watchdogd/watchdogd.c

Modified: head/usr.sbin/watchdogd/watchdogd.c
==============================================================================
--- head/usr.sbin/watchdogd/watchdogd.c	Sun Sep 26 01:41:53 2010	(r213180)
+++ head/usr.sbin/watchdogd/watchdogd.c	Sun Sep 26 01:45:33 2010	(r213181)
@@ -31,6 +31,7 @@
 #include <sys/types.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/mman.h>
 #include <sys/param.h>
 #include <sys/rtprio.h>
 #include <sys/stat.h>
@@ -115,6 +116,8 @@ main(int argc, char *argv[])
 		signal(SIGTERM, sighandler);
 
 		pidfile_write(pfh);
+		if (madvise(0, 0, MADV_PROTECT) != 0)
+			warn("madvise failed");
 
 		watchdog_loop();
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009260145.o8Q1jXUk078511>