diff --git a/audit-oom_score_adj.patch b/audit-oom_score_adj.patch new file mode 100644 index 0000000..13e9139 --- /dev/null +++ b/audit-oom_score_adj.patch @@ -0,0 +1,21 @@ +Index: src/auditd.c +=================================================================== +--- src/auditd.c.orig ++++ src/auditd.c +@@ -265,7 +265,15 @@ static int write_pid_file(void) + static void avoid_oom_killer(void) + { + int oomfd; +- ++ ++ /* Newer kernels (noticed in 2.6.36) */ ++ oomfd = open("/proc/self/oom_score_adj", O_NOFOLLOW | O_WRONLY); ++ if (oomfd >= 0) { ++ (void)write(oomfd, "0", 1); ++ close(oomfd); ++ return; ++ } ++ /* Older kernel */ + oomfd = open("/proc/self/oom_adj", O_NOFOLLOW | O_WRONLY); + if (oomfd >= 0) { + (void)write(oomfd, "-17", 3); diff --git a/audit.changes b/audit.changes index 4958a6b..9a385a9 100644 --- a/audit.changes +++ b/audit.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Sep 27 08:47:32 UTC 2010 - aj@suse.de + +- Use /proc//oom_score_adj if available. + ------------------------------------------------------------------- Mon Jun 28 06:38:35 UTC 2010 - jengelh@medozas.de diff --git a/audit.spec b/audit.spec index a4f96e3..d7e41cc 100644 --- a/audit.spec +++ b/audit.spec @@ -36,6 +36,7 @@ Patch1: audit-no_python.patch Patch2: audit-no_plugins.patch Patch3: audit-no-gss.patch Patch4: audit-as_needed.patch +Patch5: audit-oom_score_adj.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: %{name}-libs = %{version} PreReq: %insserv_prereq %fillup_prereq @@ -100,6 +101,7 @@ Authors: %patch2 -p1 %patch3 -p1 %patch4 +%patch5 %build autoreconf -fi