From patchwork Wed Aug 24 15:59:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 41893 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3522F27BBEA; Wed, 24 Aug 2022 17:09:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 82CAF27BBE9 for ; Wed, 24 Aug 2022 17:09:32 +0100 (BST) Received: from localhost ([::1]:33438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQswc-0000ul-Ss for patchwork@mira.cbaines.net; Wed, 24 Aug 2022 12:09:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQsoS-0002Bo-PN for guix-patches@gnu.org; Wed, 24 Aug 2022 12:01:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57988) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQsoQ-0003nD-OS for guix-patches@gnu.org; Wed, 24 Aug 2022 12:01:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oQsoQ-0001CR-5X for guix-patches@gnu.org; Wed, 24 Aug 2022 12:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Aug 2022 16:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57387@debbugs.gnu.org Cc: ngraves@ngraves.fr X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16613568604594 (code B ref -1); Wed, 24 Aug 2022 16:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Aug 2022 16:01:00 +0000 Received: from localhost ([127.0.0.1]:47737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQsoN-0001C2-Ib for submit@debbugs.gnu.org; Wed, 24 Aug 2022 12:01:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:34194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQsoK-0001Bt-7n for submit@debbugs.gnu.org; Wed, 24 Aug 2022 12:00:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQsoF-00023N-Fv for guix-patches@gnu.org; Wed, 24 Aug 2022 12:00:56 -0400 Received: from 5.mo582.mail-out.ovh.net ([46.105.54.31]:46903) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQsoC-0003lf-Vl for guix-patches@gnu.org; Wed, 24 Aug 2022 12:00:51 -0400 Received: from player714.ha.ovh.net (unknown [10.110.115.223]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id A7F3925339 for ; Wed, 24 Aug 2022 16:00:37 +0000 (UTC) Received: from ngraves.fr (met42-h01-213-44-161-47.dsl.sta.abo.bbox.fr [213.44.161.47]) (Authenticated sender: ngraves@ngraves.fr) by player714.ha.ovh.net (Postfix) with ESMTPSA id B43F92DC566D8; Wed, 24 Aug 2022 16:00:15 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-97G00249d7fd29-18ef-4f8b-aa6d-23b55671f8ba, C81D10A3153E3B48FB49E2C2A639964CC11D294F) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 213.44.161.47 Date: Wed, 24 Aug 2022 17:59:38 +0200 Message-ID: <87czcp8wet.fsf@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 5414734127433114338 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejuddgleekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkfggtgfgsehtqhertddttdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepjeejjeejhfdutdelheetvedthefgueelgfeuhfdttdejtdduueeukeejgeevleeunecuffhomhgrihhnpehgihhthhhusgdrtghomhdpghhithhhuhgsuhhsvghrtghonhhtvghnthdrtghomhdplhgruhhntghhphgrugdrnhgvthenucfkpheptddrtddrtddrtddpvddufedrgeegrdduiedurdegjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepphhlrgihvghrjedugedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopehguhhigidqphgrthgthhgvshesghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekvd Received-SPF: pass client-ip=46.105.54.31; envelope-from=ngraves@ngraves.fr; helo=5.mo582.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (restartd): New variable. --- gnu/packages/admin.scm | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index a4c5189222..17a400bdf6 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -51,6 +51,7 @@ ;;; Copyright © 2021 Artyom V. Poptsov ;;; Copyright © 2022 Wamm K. D. ;;; Copyright © 2022 Roman Riabenko +;;; Copyright © 2022 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -5455,6 +5456,72 @@ (define-public fail2ban mechanisms if you really want to protect services.") (license license:gpl2+))) +(define-public restartd + (let* ((commit "7044125ac55056f2663536f7137170edf92ebd75") + (revision "1.1")) + (package + (name "restartd") + (version (git-version "0.2.3" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ajraymond/restartd") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1m1np00b4zvvwx63gzysbi38i5vj1jsjvh2s0p9czl6dzyz582z0")) + (patches + (list + ;; Fix segfault when run as normal user + (origin + (method url-fetch) + (uri + (string-append "https://patch-diff.githubusercontent.com/raw" + "/ajraymond/restartd/pull/6.patch")) + (sha256 + (base32 + "1cqhy6fngvql9ynacrf4f2nc7mzypvdbab5nil96qlclfvb3far8"))) + ;; Fix compilation with gcc-10+ + (origin + (method url-fetch) + (uri + (string-append "https://patch-diff.githubusercontent.com/raw" + "/ajraymond/restartd/pull/7.patch")) + (sha256 + (base32 + "0fk33af8sgrgxibmkyjlv3j8jikgbp4mkj84yamvhv38ic6x2rw6"))))))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'ensure-compilation + (lambda _ + (substitute* "Makefile" + (("CC \\?= gcc") "CC = gcc")))) + (delete 'configure) + (replace 'install + (lambda _ + (install-file "restartd.conf" (string-append #$output "/etc")) + (install-file "restartd" (string-append #$output "/sbin")) + (install-file "restartd.8" + (string-append #$output "/share/man/man8")) + (mkdir-p (string-append #$output "/share/man/fr/man8")) + (copy-file + "restartd.fr.8" + (string-append #$output "/share/man/fr/man8/restartd.8"))))))) + (home-page "https://launchpad.net/debian/+source/restartd") + (synopsis "Daemon for restarting processes") + (description "This package provides a daemon for checking running and not +running processes. It reads the /proc directory every n seconds and does a +POSIX regexp on the process names. You can execute a script or a program if +the process is or is not running. The daemon can only be called by the root +user, but can use @code{sudo -u user} in the process called if needed.") + (license license:gpl2)))) + (define-public rex (package (name "rex")