Protect the watchdog daemon against swap OOM killer. This is similar to

SVN r199804 which added protection to sshd, cron, syslogd, and inetd.
This commit is contained in:
Ed Maste 2010-09-26 01:45:33 +00:00
parent 315490e031
commit f145c771fb

View File

@ -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();