From a774d4e29c403d77f8e5419067d8c94733e670d7 Mon Sep 17 00:00:00 2001 From: emaste Date: Sun, 26 Sep 2010 01:45:33 +0000 Subject: Protect the watchdog daemon against swap OOM killer. This is similar to SVN r199804 which added protection to sshd, cron, syslogd, and inetd. --- usr.sbin/watchdogd/watchdogd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'usr.sbin/watchdogd') diff --git a/usr.sbin/watchdogd/watchdogd.c b/usr.sbin/watchdogd/watchdogd.c index 4b58caf..7bae4ff 100644 --- a/usr.sbin/watchdogd/watchdogd.c +++ b/usr.sbin/watchdogd/watchdogd.c @@ -31,6 +31,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -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(); -- cgit v1.1