unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39283: [PATCH] gnu: Add earlyoom.
@ 2020-01-25 21:23 Pkill -9
  0 siblings, 0 replies; only message in thread
From: Pkill -9 @ 2020-01-25 21:23 UTC (permalink / raw)
  To: 39283; +Cc: Pkill -9

* gnu/packages/linux.scm (earlyoom): New variable.
---
 gnu/packages/linux.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index e5cc773ecc..892906cc70 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -6215,3 +6215,40 @@ the Linux kernel, C standard library, and libdl (for dynamic linking).  While
 ELL is designed to be efficient and compact enough for use on embedded Linux
 platforms, it is not limited to resource-constrained systems.")
     (license license:lgpl2.1+)))
+
+(define-public earlyoom
+  (package
+   (name "earlyoom")
+   (version "1.3")
+   (source (origin
+            (method git-fetch)
+            (uri (git-reference
+                  (url "https://github.com/rfjakob/earlyoom.git")
+                  (commit (string-append "v" version))))
+            (file-name (git-file-name name version))
+            (sha256
+             (base32
+              "0fwbx0y80nqgkxrc9kf9j3iwa0wbps2jmqir3pgqbc2cj0wjh0lr"))))
+   (build-system gnu-build-system)
+   (arguments
+    `(#:make-flags `("CC=gcc"
+                     ,(string-append "DESTDIR="
+                                     (assoc-ref %outputs "out"))
+                     "PREFIX=")
+      #:tests? #f ;; no tests
+      #:phases (modify-phases
+                %standard-phases
+                (delete 'configure)
+                (add-after 'install 'remove-systemd-service
+                           (lambda* (#:key outputs #:allow-other-keys)
+                             (let ((out (assoc-ref outputs "out")))
+                               (delete-file-recursively
+                                (string-append out "/etc/systemd")))
+                             #t)))))
+   (home-page "https://github.com/rfjakob/earlyoom")
+   (synopsis "Automatically kill processes in low-memory situations")
+   (description "Earlyoom checks the amount of available memory and free swap
+up to 10 times a second (less often if there is a lot of free memory).  By
+default if both are below 10%, it will kill the largest process (highest
+oom_score).  The percentage value is configurable via command line arguments.")
+   (license license:expat)))
-- 
2.25.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-25 21:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-25 21:23 bug#39283: [PATCH] gnu: Add earlyoom Pkill -9

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).