From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sII/JGtXfmDFMgEAgWs5BA (envelope-from ) for ; Tue, 20 Apr 2021 06:24:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KPLZH2tXfmAROAAAbx9fmQ (envelope-from ) for ; Tue, 20 Apr 2021 04:24:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9053815401 for ; Tue, 20 Apr 2021 06:24:10 +0200 (CEST) Received: from localhost ([::1]:52162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYhvl-0000pw-PS for larch@yhetil.org; Tue, 20 Apr 2021 00:24:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYhve-0000pQ-5P for guix-patches@gnu.org; Tue, 20 Apr 2021 00:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYhvd-0007j4-Tl for guix-patches@gnu.org; Tue, 20 Apr 2021 00:24:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lYhvd-0003iQ-Pd for guix-patches@gnu.org; Tue, 20 Apr 2021 00:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47905] gnu: Add rasdaemon. Resent-From: elaexuotee@wilsonb.com Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Apr 2021 04:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47905 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 47905@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161889263214265 (code B ref -1); Tue, 20 Apr 2021 04:24:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 Apr 2021 04:23:52 +0000 Received: from localhost ([127.0.0.1]:52543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYhvL-0003hs-KP for submit@debbugs.gnu.org; Tue, 20 Apr 2021 00:23:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:53764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYhvG-0003hh-7l for submit@debbugs.gnu.org; Tue, 20 Apr 2021 00:23:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYhvG-0000pE-2I for guix-patches@gnu.org; Tue, 20 Apr 2021 00:23:38 -0400 Received: from m42-5.mailgun.net ([69.72.42.5]:46441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYhvC-0007PP-6s for guix-patches@gnu.org; Tue, 20 Apr 2021 00:23:37 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.wilsonb.com; q=dns/txt; s=krs; t=1618892613; h=Content-Type: MIME-Version: Message-Id: Subject: From: To: Date: Sender; bh=RmOwPdUBoD5sgtplAKQj75li8AAfYbC0WD3JUSbhHdk=; b=BZtH9Fwy/DOrL5FQANrelJaSOCmFHyEhrcs4/78qbXJEJqnniGHlW72Z36nPj/I/1PIrwBCt 9oDW6u5hhoQP700KwihFtU4NuVOgRPer6TWh49Z6dtH7xYSY/GDGQxntQ3BoAGbsdWFDoCQZ 6b25a/2rk7zYgbBL5tbUdzAlkTL/StXUx1uNKocJr+2iBgkcPHOOxOgMPUhBwC0WEIdgcgxO hhYNH3A72wXRbutZi4Vdzk3e5n++MfHytjESAiQh8tA1Q6AGy7RJ+P4BCQOzedZaUekUfpHa Tctf3h3nbOaa+3PiO7ylSGNjN0XtN+OXjuHrwva1HU/TuS/No10WuQ== X-Mailgun-Sending-Ip: 69.72.42.5 X-Mailgun-Sid: WyI5MmEzMyIsICJndWl4LXBhdGNoZXNAZ251Lm9yZyIsICIwODU0N2EiXQ== Received: from wilsonb.com (wilsonb.com [104.199.203.42]) by smtp-out-n01.prod.us-east-1.postgun.com with SMTP id 607e574387ce1fbb56ccb9ec (version=TLS1.3, cipher=TLS_AES_128_GCM_SHA256); Tue, 20 Apr 2021 04:23:31 GMT Received: from localhost (x108155.dynamic.ppp.asahi-net.or.jp [122.249.108.155]) by wilsonb.com (Postfix) with ESMTPSA id 970E4A3269 for ; Tue, 20 Apr 2021 04:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wilsonb.com; s=201703; t=1618892609; bh=RmOwPdUBoD5sgtplAKQj75li8AAfYbC0WD3JUSbhHdk=; h=Date:To:From:Subject:From; b=4QTIfG0rhnjXmRTeP7LKbWQWRssIwzpDLcKtKc8MGk7wEtBU68y6rFHuuShhnwwij fqfQ7b4epvSGMuUanyBCYS4iN3g/w/M5XxYj808OGNOO6nv707r16l+BcBkaPf5uaX XwO3jmQWN7nkDye1fiqcJXMCkkfitzZik2+0v4EKU/zMjuVaviIRNExmECOV5g8VBA tYuGMRHyF1LAsxulC6e8HV6kmJ/Do1XWwVjdeoICwSR3M2oSvmCuU3XY8PXkOa7qM6 3uk6pL2Ck7XUt06cVNl3x+sCtGEXSttajjVJoM3et7V5Xun1Ik6aRmkoOB1Fkli63P PSiIY0LsefSsHd3+5KrcIFH0Au+2ZjqPAND7hHWepfZZKwbCVb5IvExn/hN2VLrc8q LV+3CBJiGwaFQ8+cdq16jsIEUb6gDEPaGiuVnoDgi+3aZVS/fIgkFYP8dwSsR+E+jC o77JnxSpxuDXU+gSAJM5ba4ntJUHuWY7pmibdONHZnb6iEjjOVWNZBs/mnggIHaLwJ +DIw9pM/CMfn9zqB47qwn0RSE2FrGRPo5M3uLYEx7p/btUhG6M0o6imCF0a5oNHllp G6x3c8NLo/X+Pf/FrP4QBaRLzawlgh/4aQ+z2xL+ss9jzkSSIjMceEX1+B8aATbwQ3 yQ9SuvufQmiZBbTGXeyCawPE= Date: Tue, 20 Apr 2021 13:24:37 +0900 Message-Id: <31MWDEN7Q9XOV.2001N5J6G4U9K@wilsonb.com> User-Agent: mblaze/1.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_743bcd69150b553b6c7dd9f5_=_" Received-SPF: pass client-ip=69.72.42.5; envelope-from=bounce+686de0.08547a-guix-patches=gnu.org@mg.wilsonb.com; helo=m42-5.mailgun.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: elaexuotee@wilsonb.com X-ACL-Warn: , elaexuotee--- via Guix-patches From: elaexuotee--- via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618892651; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=RmOwPdUBoD5sgtplAKQj75li8AAfYbC0WD3JUSbhHdk=; b=KYfheqkUUbBM+4v4MrjhvCeixx7jVmyCFa6dKv/BuLr9caZNsg80hHop7f3H3t463b+wBj yNC5OBfzKWxALmqYDsrMfBpsbuUzBe282gU574xYKWfvzOsKT8YugwfB00g5uBi2QAmi02 2Pgsbhmag/C9mkws8r66bFI66mkbiqR6JrNaNuvnmUE9IIOZ7Q90N4j4du45vwmhqN5P1o 2ijBh78jCfT3ljUvnvvapmMXancyWMuMKomI2rF0pVpdINl4fOA6JQ/WRtr9luD4s41xZP 6QITtnbBEeTI8soiIJ6ALhSB/LiWXr9RobCGXZDebBUaewHxTdXLcMPGP9bBmg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618892651; a=rsa-sha256; cv=none; b=qey0FPjk3f0YhEl2y63y075lDltkzWxWDZWp5nFnbDpLUoqCT5Y3WKtQRBCowjvJ3LEhOM 3aXekHMPv8jZSV/uTPLcjQ1Pwp8u7rOwEVheU8lCWApklvGhEJfEK0S593JZe4tSL03q5u fGifXQNtxqDXRKEx4eVgxrYpjqc9aIsma2wlVlVmuOIcclMOfbBZpeWyTp+qtM8Ndc+j4P G6G6+7ls17GGpHqDuU3XHkU2mZkQRsxGyQxsA/qa4Mwfa2toheZ0dWc3T1L3r4t3IwBXpP pARJWAYNSW461SHxZXrj7VaNy73jSFzyaHqNtlGlayoZSUiaZrBik3M7QAAlrw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mg.wilsonb.com header.s=krs header.b=BZtH9Fwy; dkim=fail ("headers rsa verify failed") header.d=wilsonb.com header.s=201703 header.b=4QTIfG0r; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.84 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mg.wilsonb.com header.s=krs header.b=BZtH9Fwy; dkim=fail ("headers rsa verify failed") header.d=wilsonb.com header.s=201703 header.b=4QTIfG0r; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 9053815401 X-Spam-Score: -2.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: wtdtB97qMlaR This is a multipart message in MIME format. ------_=_743bcd69150b553b6c7dd9f5_=_ Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable This is my first patch to gnu/services (and by inclusion doc/guix.texi), so= please scrutinize with abandon! I did all the standard sanity checks for the package definition (guix lint,= etc/indent-code.el, guix build --check); however, I wasn't sure about the service, so the sanity checks were limited to testing in a vm. Cheers! ------_=_743bcd69150b553b6c7dd9f5_=_ Content-Disposition: attachment; filename=0001-gnu-Add-rasdaemon.patch Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable =46rom 1d4e60a9578d3572bf1caff11d0b17e4bc8f1ea9 Mon Sep 17 00:00:00 2001 =46rom: "B. Wilson" =44ate: Tue, 20 Apr 2021 11:49:26 +0900 =53ubject: [PATCH] gnu: Add rasdaemon. =54o: guix-patches@gnu.org =0A* gnu/packages/linux.scm (rasdaemon): New variable. =2A gnu/services/linux.scm (rasdaemon-configuration) =20 (rasdaemon-configuration?, rasdaemon-configuration-record?) =20 (rasdaemon-service-type): New variables. =2A doc/guix.texi (Linux Services): Document it. =2D-- =20doc/guix.texi | 29 +++++++++++++++++++++++++ =20gnu/packages/linux.scm | 45 ++++++++++++++++++++++++++++++++++++++ =20gnu/services/linux.scm | 49 ++++++++++++++++++++++++++++++++++++++++++ =203 files changed, 123 insertions(+) =0Adiff --git a/doc/guix.texi b/doc/guix.texi =69ndex 58bcfbdbb5..73479b8fcf 100644 =2D-- a/doc/guix.texi =2B++ b/doc/guix.texi =40@ -88,6 +88,7 @@ Copyright @copyright{} 2020 John Soo@* =20Copyright @copyright{} 2020 Jonathan Brielmaier@* =20Copyright @copyright{} 2020 Edgar Vincent@* =20Copyright @copyright{} 2021 Maxime Devos@* =2BCopyright @copyright{} 2021 B. Wilson@* =20= =20Permission is granted to copy, distribute and/or modify this document =20under the terms of the GNU Free Documentation License, Version 1.3 or =40@ -31457,6 +31458,34 @@ parameters, can be done as follow: =20@end lisp =20@end deffn =20= =2B@cindex rasdaemon =2B@cindex Platform Reliability, Availability and Serviceability daemon =2B@subsubheading Rasdaemon Service =2B =2BThe Rasdaemon service provides a monitor for Platform Reliability, =2BAvailability, and Serviceability (RAS) events in the Linux kernel. =2B =2B@defvr {Scheme Variable} rasdaemon-service-type =2BService type for the @command{rasdaemon} service. It accepts a =2B@code{rasdaemon-configuration} object. Instantiating like =2B =2B@lisp =2B(service rasdaemon-service-type) =2B@end lisp =2B =2Bwill load with a default configuration. =2B@end defvr =2B =2B@deftp {Data Type} rasdaemon-configuration =2BThe data type representing the configuration of @command{rasdaemon}. =2B =2B@table @asis =2B@item @code{record?} (default: @code{#f}) =2BA boolean indicating whether to record the events in an SQLite database.= =20 The =2Bdatabase location is hard-coded to @file{/var/lib/rasdaemon/ras-mc_event= =2Edb}. =2B@end table =2B@end deftp =2B =20@cindex zram =20@cindex compressed swap =20@cindex Compressed RAM-based block devices =64iff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm =69ndex 1ea9d80834..fe464bcc8e 100644 =2D-- a/gnu/packages/linux.scm =2B++ b/gnu/packages/linux.scm =40@ -53,6 +53,7 @@ =20;;; Copyright =C2=A9 2020 Zhu Zihao =20;;; Copyright =C2=A9 2020 David Dashyan =20;;; Copyright =C2=A9 2020 pukkamustard =2B;;; Copyright =C2=A9 2021 B. Wilson =20;;; =20;;; This file is part of GNU Guix. =20;;; =40@ -130,6 +131,7 @@ =20 #:use-module (gnu packages sdl) =20 #:use-module (gnu packages serialization) =20 #:use-module (gnu packages slang) =2B #:use-module (gnu packages sqlite) =20 #:use-module (gnu packages texinfo) =20 #:use-module (gnu packages tls) =20 #:use-module (gnu packages valgrind) =40@ -8037,3 +8039,46 @@ kernel side implementation.") =20read-only file system optimized for resource-scarce devices. This packa= =67e =20provides user-space tools for creating EROFS file systems.") =20 (license license:gpl2+))) =2B =2B(define-public rasdaemon =2B (package =2B (name "rasdaemon") =2B (version "0.6.6") =2B (source =2B (origin =2B (method git-fetch) =2B (uri (git-reference =2B (url "https://github.com/mchehab/rasdaemon") =2B (commit (string-append "v" version)))) =2B (file-name (git-file-name name version)) =2B (sha256 =2B (base32 "13g39x19lfjf9izdcb0nlyfjrgpliivhv4nw3ndgyzi59l3yqc0v"))= =29) =2B (native-inputs `(("autoconf" ,autoconf) =2B ("automake" ,automake) =2B ("libtool" ,libtool))) =2B (inputs `(("sqlite" ,sqlite))) =2B (arguments =2B `(#:configure-flags '("--enable-all" =2B "--localstatedir=3D/var") =2B #:phases =2B (modify-phases %standard-phases =2B (add-before 'configure 'munge-autotools =2B (lambda _ =2B ;; For some reason upstream forces sysconfdir=3D/etc. This= =20results =2B ;; in EPERM during the install phase. Removing the offendi= =6Eg =2B ;; line lets sysconfdir correctly pick up DESTDIR. =2B (substitute* "configure.ac" =2B (("^test .* sysconfdir=3D/etc\n$") "")) =2B ;; Upstream tries to create /var/lib/rasdaemon at install t= =69me. =2B ;; This results in EPERM on guix. Instead, the service sho= =75ld =2B ;; create this at activation time. =2B (substitute* "Makefile.am" =2B (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") "")))= =29))) =2B (build-system gnu-build-system) =2B (home-page "https://github.com/mchehab/rasdaemon") =2B (synopsis "Platform Reliability, Availability and Serviceability too= =6Cs") =2B (description "The @code{rasdaemon} program is a daemon which monitor= =73 the =2Bplatform Reliablity, Availability and Serviceability (RAS) reports from = =74he =2BLinux kernel trace events. These trace events are logged in =2B/sys/kernel/debug/tracing, reporting them via syslog/journald.") =2B (license license:gpl2+))) =64iff --git a/gnu/services/linux.scm b/gnu/services/linux.scm =69ndex 340b330030..01723efc07 100644 =2D-- a/gnu/services/linux.scm =2B++ b/gnu/services/linux.scm =40@ -3,6 +3,7 @@ =20;;; Copyright =C2=A9 2020 Brice Waegeneire =20;;; Copyright =C2=A9 2020 Efraim Flashner =20;;; Copyright =C2=A9 2021 raid5atemyhomework =2B;;; Copyright =C2=A9 2021 B. Wilson =20;;; =20;;; This file is part of GNU Guix. =20;;; =40@ -47,6 +48,11 @@ =20= =20 kernel-module-loader-service-type =20= =2B rasdaemon-configuration =2B rasdaemon-configuration? =2B rasdaemon-configuration-record? =2B rasdaemon-service-type =2B =20 zram-device-configuration =20 zram-device-configuration? =20 zram-device-configuration-size =40@ -188,6 +194,49 @@ representation." =20 (extend append) =20 (default-value '()))) =20= =2B=0C =2B;;; =2B;;; Reliability, Availability, and Servicability (RAS) daemon =2B;;; =2B =2B(define-record-type* =2B rasdaemon-configuration make-rasdaemon-configuration =2B rasdaemon-configuration? =2B (record? rasdaemon-configuration-record? (default #f))) =2B =2B(define (rasdaemon-configuration->command-line-args config) =2B "Translate to its command line arguments =2B representation" =2B (let ((record? (rasdaemon-configuration-record? config))) =2B `(,(file-append rasdaemon "/sbin/rasdaemon") =2B "--foreground" ,@(if record? '("--record") '())))) =2B =2B(define (rasdaemon-activation config) =2B (let ((record? (rasdaemon-configuration-record? config)) =2B (rasdaemon-dir "/var/lib/rasdaemon")) =2B (with-imported-modules '((guix build utils)) =2B #~(if #$record? (mkdir-p #$rasdaemon-dir))))) =2B =2B(define (rasdaemon-shepherd-service config) =2B (shepherd-service =2B (documentation "Run rasdaemon") =2B (provision '(rasdaemon)) =2B (start #~(make-forkexec-constructor =2B '#$(rasdaemon-configuration->command-line-args config) =2B #:log-file "/var/log/rasdaemon.log")) =2B (stop #~(make-kill-destructor)))) =2B =2B(define rasdaemon-service-type =2B (service-type =2B (name 'rasdaemon) =2B (default-value (rasdaemon-configuration)) =2B (extensions =2B (list (service-extension shepherd-root-service-type =2B (compose list rasdaemon-shepherd-service)) =2B (service-extension activation-service-type rasdaemon-activatio= =6E))) =2B (compose concatenate) =2B (description "Run @command{rasdaemon}, the RAS monitor"))) =2B =20=0C =20;;; =20;;; Kernel module loader. =2D-=20 =32.31.1 =0A= ------_=_743bcd69150b553b6c7dd9f5_=_--