From unknown Fri Aug 15 20:51:42 2025 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 From: Nicolas Graves Date: Wed, 24 Aug 2022 17:59:38 +0200 Message-ID: <87czcp8wet.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * 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 =C2=A9 2021 Artyom V. Poptsov ;;; Copyright =C2=A9 2022 Wamm K. D. ;;; Copyright =C2=A9 2022 Roman Riabenko +;;; Copyright =C2=A9 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+))) =20 +(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 \\?=3D gcc") "CC =3D gcc")))) + (delete 'configure) + (replace 'install + (lambda _ + (install-file "restartd.conf" (string-append #$output "/et= c")) + (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 an= d 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 ro= ot +user, but can use @code{sudo -u user} in the process called if needed.") + (license license:gpl2)))) + (define-public rex (package (name "rex") --=20 2.37.2 <#secure method=3Dpgpmime mode=3Dsign> --=20 Best regards, Nicolas Graves From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Aug 2022 18:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves , 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166136455318430 (code B ref 57387); Wed, 24 Aug 2022 18:10:01 +0000 Received: (at 57387) by debbugs.gnu.org; 24 Aug 2022 18:09:13 +0000 Received: from localhost ([127.0.0.1]:48183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQuoS-0004nC-Jz for submit@debbugs.gnu.org; Wed, 24 Aug 2022 14:09:12 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:57352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQuoQ-0004n3-R2 for 57387@debbugs.gnu.org; Wed, 24 Aug 2022 14:09:11 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by laurent.telenet-ops.be with bizsmtp id BW972800H20ykKC01W97Fn; Wed, 24 Aug 2022 20:09:09 +0200 Message-ID: <31ad9b2c-6bfe-c472-0ba2-ad14d689ef1d@telenet.be> Date: Wed, 24 Aug 2022 20:09:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US References: <87czcp8wet.fsf@ngraves.fr> From: Maxime Devos In-Reply-To: <87czcp8wet.fsf@ngraves.fr> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------tUbwrWrZ0wjnNcTi71YW3LXQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1661364549; bh=7GW/k1GM5mE4cAAjzMU+FESCqr/JFJag34E2QNfgyGs=; h=Date:To:References:From:Subject:In-Reply-To; b=MUdEmA3GY+TluweemonER7lUvtJG7YeAPJsr99hnzob+axGLgBZxXZGsoWzqdJxwP 4nyYzRIl494E9mnt+zBMjD1NLnHxXJFhMce7ATJG97L8yW8wKN3mcmtETrL9eZuFOw m1SKJAM/y4yo8De3i+i9C1khfaTLi/80kXBxVpUZj07ItsYZ/b6CtUoWKLiW37BPOH HIzSCPZOrh2VLFhFlgwRltZJjID0H4Q8D9pnU9S6627VL1T9BaOxCMt+xgnE5nwKIS hZQrL4cIfY1MxLDnO3j5fKS4dqZ5qsz4ZrgwGFGAka3YP2teCZaKix+kTuKFHFXqaS RwIMKthas0BsA== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------tUbwrWrZ0wjnNcTi71YW3LXQ Content-Type: multipart/mixed; boundary="------------EyH7vkVPx12NW0hoTjDd6wF2"; protected-headers="v1" From: Maxime Devos To: Nicolas Graves , 57387@debbugs.gnu.org Message-ID: <31ad9b2c-6bfe-c472-0ba2-ad14d689ef1d@telenet.be> Subject: Re: [bug#57387] [PATCH] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> In-Reply-To: <87czcp8wet.fsf@ngraves.fr> --------------EyH7vkVPx12NW0hoTjDd6wF2 Content-Type: multipart/mixed; boundary="------------OGEsoYCB09Z6I8BUJalUJXDu" --------------OGEsoYCB09Z6I8BUJalUJXDu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 T24gMjQtMDgtMjAyMiAxNzo1OSwgTmljb2xhcyBHcmF2ZXMgdmlhIEd1aXgtcGF0Y2hlcyB2 aWEgd3JvdGU6DQoNCj4gKyAgICAgICAgIChyZXZpc2lvbiAiMS4xIikpDQoNCiIxLjEiIC0+ ICIxIiAoJ3JldmlzaW9uJyBtdXN0IGJlIGEgc3RyaW5nIHdpdGggYSBudW1iZXIsIGFzIGV4 cGVjdGVkIGJ5IA0KaHR0cHM6Ly9pc3N1ZXMuZ3VpeC5nbnUub3JnLzUzMTQ0KS4NCg0KQWxz bywgd2h5IGlzIGFuIHVucmVsZWFzZWQgdmVyc2lvbiB1c2VkPyBJIGFzc3VtZSBiZWNhdXNl IG9mIGxhY2sgb2YgDQphY3Rpdml0eSB1cHN0cmVhbSwgYnV0IGEgY29tbWVudCB3b3VsZCBo YXZlIGJlZW4gdXNlZnVsLg0KDQo+ICsgICAgICAgICAgICAgICAgKHN1YnN0aXR1dGUqICJN YWtlZmlsZSINCj4gKyAgICAgICAgICAgICAgICAgICgoIkNDIFxcPz0gZ2NjIikgIkNDID0g Z2NjIikpKSkNCkZvciBjcm9zcy1jb21waWxhdGlvbiwgdXNlIChjYy1mb3ItdGFyZ2V0KQ0K DQpBY2NvcmRpbmcgdG8gRGViaWFuLCB0aGUgaG9tZS1wYWdlIGlzIA0KPGh0dHBzOi8vZ2l0 aHViLmNvbS9hanJheW1vbmQvcmVzdGFydGQ+Lg0KDQpMb29raW5nIGF0IHNvbWUgc291cmNl IGZpbGVzLCBpdCBhcHBlYXJzIHRvIGJlIGdwbDItb3ItbGF0ZXIsIG5vdCBncGwyLW9ubHku DQoNCkluIHJlc3RhcnRkLmMsIGl0IGlzIG1pc3NpbmcgZXJyb3IgY2hlY2tpbmcgZm9yICdm b3BlbicsICdtYWxsb2MnIGFuZCANCidzdHJkdXAnLg0KDQppbiBjb25maWcuYywgaXQgaXMg bWlzc2luZyBlcnJvciBjaGVja2luZyBmb3IgJ21hbGxvYyfCoCAoYW5kIGZvciBwcmludGYg DQpvbiBzdGRlcnIsIGJ1dCB0aGVyZSBpc24ndCBtdWNoIHRoYXQgY2FuIGJlIG9kb25lIGlu IHRoYXQgY2FzZSkuIEFsc28gDQpwcmludGYgb24gc3Rkb3V0LCB0aG91Z2ggbGVzcyBpbXBv cnRhbnQuDQoNCk9uIHRoZSBwYXRjaGVzOiBJSVVDLCBpbiBjYXNlIGFkZGl0aW9uYWwgY29t bWl0cyBhcmUgYWRkZWQgdG8gdGhlIFBSLCANCnRoZSBwYXRjaCBpcyB1cGRhdGVkIGFwcHJv cHJpYXRlbHksIHNvIHRoZXNlIHBhdGNoZXMgYXJlIHZvbGF0aWxlLiBFdmVuIA0KaWYgdGhh dCBkb2Vzbid0IGhhcHBlbiwgdGhlIHBhdGNoIGdlbmVyYXRpb24gYWxnb3JpdGhtIGNvdWxk IGNoYW5nZSANCmxhdGVyLiBBcyBzdWNoLCBjb3B5aW5nIHRoZXNlIGludG8gZ251L3BhY2th Z2VzL3BhdGNoZXMgKyBzZWFyY2gtcGF0aGVzIA0KaXMgcmVjb21tZW5kZWQNCg0KPiBZb3Ug Y2FuIGV4ZWN1dGUgYSBzY3JpcHQgb3IgYSBwcm9ncmFtIGlmIHRoZSBwcm9jZXNzIGlzIG9y IGlzIG5vdCBydW5uaW5nLg0KTWF5YmU6ICdUaGUgZGFlbW9uIHJ1bnMgYW4gdXNlci1wcm92 aWRlZCBzY3JpcHQgYmFzZWQgb25jZSBhIHByb2dyYW0gDQpzdGFydHMgcnVubmluZyBvciBz dG9wcyBydW5uaW5nLicgVGhhdCBzZWVtcyBhIGxpdHRsZSBjbGVhcmVyIEVuZ2xpc2ggdG8g DQptZSAoJ2l0IGlzIHJ1bm5pbmcgb3Igbm90IHJ1bm5pbmcnIGlzIGFsd2F5cyB0cnVlLCBh bmQgc2NyaXB0cyAvIA0KcHJvZ3JhbXMgY2FuIGJlIHJ1biwgYnV0IGl0J3Mgbm90IGEgY2xh aW0gYWJvdXQgcmVzdGFydGQpLg0KDQpHcmVldGluZ3MsDQpNYXhpbWUuDQoNCg== --------------OGEsoYCB09Z6I8BUJalUJXDu Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------OGEsoYCB09Z6I8BUJalUJXDu-- --------------EyH7vkVPx12NW0hoTjDd6wF2-- --------------tUbwrWrZ0wjnNcTi71YW3LXQ Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYwZpQwUDAAAAAAAKCRBJ4+4iGRcl7oej AQDNgOSD/JAJ3ESjf4HGNQs7x3web8AwnoLLX/6xlQItkQD/cAiqkNdo8C6e8LQ0GM2irhNG3OxD VBglxb42Zk3YHgA= =2n0c -----END PGP SIGNATURE----- --------------tUbwrWrZ0wjnNcTi71YW3LXQ-- From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: "(" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Aug 2022 18:15:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "Maxime Devos" , "Nicolas Graves" , <57387@debbugs.gnu.org> Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166136490118964 (code B ref 57387); Wed, 24 Aug 2022 18:15:03 +0000 Received: (at 57387) by debbugs.gnu.org; 24 Aug 2022 18:15:01 +0000 Received: from localhost ([127.0.0.1]:48192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQuu4-0004vm-2n for submit@debbugs.gnu.org; Wed, 24 Aug 2022 14:15:01 -0400 Received: from knopi.disroot.org ([178.21.23.139]:58742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQuty-0004vZ-EH for 57387@debbugs.gnu.org; Wed, 24 Aug 2022 14:14:58 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id E91AC4004B; Wed, 24 Aug 2022 20:14:52 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5anJea0FUjr1; Wed, 24 Aug 2022 20:14:52 +0200 (CEST) Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1661364891; bh=7SwSmyW4RpxJa16PGcB0P6Db20yCb7GTYtwWHyw5V4s=; h=Date:Subject:From:To:References:In-Reply-To; b=Yhr08pjfqHarhdc4FmOvwb8gujbfrSySQ8vmkuuSSw4/Z4LQubV2emAh10U2ycIsW 8GlAxyMNK0kDpDaPuLhSLkHivePolIQBQMPthY24H1zZYANNP03cWZYDFiZuZuQ0Ow Ym9tkKq4+Gz+VP7oZYCs3EGr/T7E0hNyz3QmGhoMJxs33Vo9k79zg+KmINFAQeg0Eo ug9Ojmsgk0IFf/S1ab8I1BiXcyiGEf41+dzSsJc3WwSNH/N9tk5wMG6craHxEU86jM qh6pFTKCi49eAHGLmHzzae2mKuIDXylDfN9M5H1kOs5ZzNe9lltugJYRxOC7WXqvKj +6QIPxZhmr8NQ== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 24 Aug 2022 19:14:51 +0100 Message-Id: From: "(" References: <87czcp8wet.fsf@ngraves.fr> <31ad9b2c-6bfe-c472-0ba2-ad14d689ef1d@telenet.be> In-Reply-To: <31ad9b2c-6bfe-c472-0ba2-ad14d689ef1d@telenet.be> X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed Aug 24, 2022 at 7:09 PM BST, Maxime Devos wrote: > > + (substitute* "Makefile" > > + (("CC \\?=3D gcc") "CC =3D gcc")))) > For cross-compilation, use (cc-for-target) Also, you can replace this substitution with make-flags: #:make-flags #~(list (string-append "CC=3D" #$(cc-for-target))) -- ( From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> In-Reply-To: <87czcp8wet.fsf@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Aug 2022 09:15:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166141889911937 (code B ref 57387); Thu, 25 Aug 2022 09:15:03 +0000 Received: (at 57387) by debbugs.gnu.org; 25 Aug 2022 09:14:59 +0000 Received: from localhost ([127.0.0.1]:48958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR8x1-00036S-7W for submit@debbugs.gnu.org; Thu, 25 Aug 2022 05:14:59 -0400 Received: from 5.mo582.mail-out.ovh.net ([46.105.54.31]:42307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR8wy-00036I-Ga for 57387@debbugs.gnu.org; Thu, 25 Aug 2022 05:14:57 -0400 Received: from player779.ha.ovh.net (unknown [10.110.115.139]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 57F4B257CE for <57387@debbugs.gnu.org>; Thu, 25 Aug 2022 09:14:55 +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 player779.ha.ovh.net (Postfix) with ESMTPSA id B1F8E2DB91EED for <57387@debbugs.gnu.org>; Thu, 25 Aug 2022 09:14:53 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-103G00540c523a8-9420-454c-87b0-2e27840c7e5d, EE7AED07EA83ED23F885A8103ECAE878C220A66D) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 213.44.161.47 From: Nicolas Graves Date: Thu, 25 Aug 2022 11:14:53 +0200 Message-ID: <87y1vck7le.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 4435482683604329157 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejfedgudefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffufffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeevhffflefhhfffvedtkedvudfggfeifeeljedtueeutdeiieefueejieeuhffgieenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhlrghunhgthhhprggurdhnvghtpdguvggsihgrnhdrohhrghenucfkpheptddrtddrtddrtddpvddufedrgeegrdduiedurdegjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepphhlrgihvghrjeejledrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeehjeefkeejseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkedv X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/admin.scm (restartd): New variable. --- gnu/packages/admin.scm | 53 +++++++++++++++++++ .../patches/restartd-fix-compilation.patch | 53 +++++++++++++++++++ .../restartd-fix-segfault-normal-user.patch | 45 ++++++++++++++++ 3 files changed, 151 insertions(+) create mode 100644 gnu/packages/patches/restartd-fix-compilation.patch create mode 100644 gnu/packages/patches/restartd-fix-segfault-normal-user.= patch diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index a4c5189222..17ebd5fd7b 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -51,6 +51,7 @@ ;;; Copyright =C2=A9 2021 Artyom V. Poptsov ;;; Copyright =C2=A9 2022 Wamm K. D. ;;; Copyright =C2=A9 2022 Roman Riabenko +;;; Copyright =C2=A9 2022 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -5455,6 +5456,58 @@ (define-public fail2ban mechanisms if you really want to protect services.") (license license:gpl2+))) +(define-public restartd + (let* ((commit "7044125ac55056f2663536f7137170edf92ebd75") + ;; Version is 0.2.4 in the version file in the repo + ;; but not in github tags. + ;; It is released as 0.2.3-1.1 for other distributions. + ;; Probably because of the lack of activity upstream. + (revision "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 + (search-patches "restartd-fix-segfault-normal-user.patch" + "restartd-fix-compilation.patch")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ; no tests + #:make-flags + #~(list (string-append "CC=3D" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda _ + (install-file "restartd.conf" (string-append #$output "/et= c")) + (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 an= d not +running processes. It reads the /proc directory every n seconds and does a +POSIX regexp on the process names. The daemon runs an user-provided script +when it detects a program in the running processes, or an alternate script= if +it doesn't detect the program. 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") diff --git a/gnu/packages/patches/restartd-fix-compilation.patch b/gnu/pack= ages/patches/restartd-fix-compilation.patch new file mode 100644 index 0000000000..a380205675 --- /dev/null +++ b/gnu/packages/patches/restartd-fix-compilation.patch @@ -0,0 +1,53 @@ +From 84edc2042bb0a82e65bd4d165b706519886b4075 Mon Sep 17 00:00:00 2001 +From: Sudip Mukherjee +Date: Mon, 10 Aug 2020 19:39:30 +0100 +Subject: [PATCH] Fix build with gcc-10 + +Bug: https://bugs.debian.org/957761 +Signed-off-by: Sudip Mukherjee +--- + config.h | 12 ++++++------ + restartd.c | 7 +++++++ + 2 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/config.h b/config.h +index fabaa2b..a79b28e 100644 +--- a/config.h ++++ b/config.h +@@ -25,12 +25,12 @@ + + #define DEFAULT_CONFIG "/etc/restartd.conf" + +-int debug; +-int config_process_number; +-int check_interval; +-int foreground; +-struct config_process_type *config_process; +-char *config_file; ++extern int debug; ++extern int config_process_number; ++extern int check_interval; ++extern int foreground; ++extern struct config_process_type *config_process; ++extern char *config_file; + + typedef struct config_process_type { + char name[64]; +diff --git a/restartd.c b/restartd.c +index 2aa720c..617b298 100644 +--- a/restartd.c ++++ b/restartd.c +@@ -35,6 +35,13 @@ + + #include "config.h" + ++int debug; ++int config_process_number; ++int check_interval; ++int foreground; ++struct config_process_type *config_process; ++char *config_file; ++ + /* SIGTERM & SIGHUP handler */ + void got_signal(int sig) + { diff --git a/gnu/packages/patches/restartd-fix-segfault-normal-user.patch b= /gnu/packages/patches/restartd-fix-segfault-normal-user.patch new file mode 100644 index 0000000000..5c28c3b2ad --- /dev/null +++ b/gnu/packages/patches/restartd-fix-segfault-normal-user.patch @@ -0,0 +1,45 @@ +From 67d7308ba52d2c605d0175c14c34ff09c9d322fb Mon Sep 17 00:00:00 2001 +From: Yin Kangkai +Date: Sat, 1 Oct 2016 13:52:58 +0800 +Subject: [PATCH] Fix segfault when run as normal user + +Also exit immediately when "restartd -h" +--- + restartd.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/restartd.c b/restartd.c +index 2aa720c..1d46fe1 100644 +--- a/restartd.c ++++ b/restartd.c +@@ -118,6 +118,7 @@ int main(int argc, char *argv[]) + " -i : the check interval in second\n" + " -l : list configuration options\n" + " -h : help\n\n", VERSION); ++ exit(0); + } + } + +@@ -187,6 +188,10 @@ int main(int argc, char *argv[]) + } + + out_proc =3D fopen("/var/run/restartd.pid", "wt"); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd.pid"); ++ return -1; ++ } + fprintf(out_proc, "%d", getpid()); + fclose(out_proc); + +@@ -244,9 +249,9 @@ int main(int argc, char *argv[]) + if (strlen(config_process[i].processes) > 0) { + if (strlen(config_process[i].running) > 0) { + strcpy(config_process[i].status, "running"); +- syslog(LOG_INFO, "%s is running, executing '%s'", ++ /* syslog(LOG_INFO, "%s is running, executing '%s'= ", + config_process[i].name, +- config_process[i].running); ++ config_process[i].running); */ + system(config_process[i].running); + } else { + strcpy(config_process[i].status, "running"); -- 2.37.2 From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> In-Reply-To: <87czcp8wet.fsf@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Aug 2022 09:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166141901812203 (code B ref 57387); Thu, 25 Aug 2022 09:17:02 +0000 Received: (at 57387) by debbugs.gnu.org; 25 Aug 2022 09:16:58 +0000 Received: from localhost ([127.0.0.1]:48972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR8yw-0003Al-GG for submit@debbugs.gnu.org; Thu, 25 Aug 2022 05:16:58 -0400 Received: from 13.mo583.mail-out.ovh.net ([87.98.182.191]:55103) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR8yu-0003Ac-MY for 57387@debbugs.gnu.org; Thu, 25 Aug 2022 05:16:57 -0400 Received: from player787.ha.ovh.net (unknown [10.110.115.223]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id AC29724F80 for <57387@debbugs.gnu.org>; Thu, 25 Aug 2022 09:16:54 +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 player787.ha.ovh.net (Postfix) with ESMTPSA id 3E9202E0C72E6 for <57387@debbugs.gnu.org>; Thu, 25 Aug 2022 09:16:53 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-98R00268ee38bd-fad1-45b0-b9f0-7477c7d1ad0c, EE7AED07EA83ED23F885A8103ECAE878C220A66D) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 213.44.161.47 From: Nicolas Graves Date: Thu, 25 Aug 2022 11:16:48 +0200 Message-ID: <87v8qgk7i7.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 4468978207883125445 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejfedgudefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffufffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepueejleeileejfffhleetjedtleejheevudffleevgfdufeekhefgvddvveegveefnecukfhppedtrddtrddtrddtpddvudefrdeggedrudeiuddrgeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejkeejrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepheejfeekjeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekfe X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Made suggested changes, rephrased the description. But I never learned C and am not at ease for adding checks in C source code, sorry. -- Best regards, Nicolas Graves From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Aug 2022 10:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves , 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166142365028938 (code B ref 57387); Thu, 25 Aug 2022 10:35:02 +0000 Received: (at 57387) by debbugs.gnu.org; 25 Aug 2022 10:34:10 +0000 Received: from localhost ([127.0.0.1]:49108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRABe-0007Wf-3Y for submit@debbugs.gnu.org; Thu, 25 Aug 2022 06:34:10 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:46956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRABY-0007WT-R7 for 57387@debbugs.gnu.org; Thu, 25 Aug 2022 06:34:08 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by laurent.telenet-ops.be with bizsmtp id Bma22800220ykKC01ma2yP; Thu, 25 Aug 2022 12:34:03 +0200 Message-ID: Date: Thu, 25 Aug 2022 12:34:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US References: <87czcp8wet.fsf@ngraves.fr> <87v8qgk7i7.fsf@ngraves.fr> From: Maxime Devos In-Reply-To: <87v8qgk7i7.fsf@ngraves.fr> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------jSMM8NSAKkWndRc6Hnzb4J71" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1661423643; bh=6zv9VKxtlWUz6Gx8vVCTFOuXLOICDVAVYjYhFWvkESk=; h=Date:Subject:To:References:From:In-Reply-To; b=SvBaFyvkF0o62LAV5B1pfUypgMhEVKNxOmfvtnYFfYlRUMBJx4ZvU89IBte7yL7SL DU+9CJTCQ94cGIMRuVDStK5VsMXmaiNRRYUoIZSDBvZDERo5Rp+SG/DPbSnn4vrv7G 7ASvWU7FbVwUGHzefxlSjoKcX+cb9eDVdR3keEGW4Hk82sZ9S5e+TFahd/qxkHQC74 xqWBIn1Nch9qRBOcHA7csdnJmYn8xqFTJWAziv4PZCz9b0z3xzkDj7hbfmasSA1WAB dXSh2MV/xVjSmTF0NNTPsTTfZ8+fkmzWx6Lku4ADLMaUM4EJJfhxtJpqOVxGZ6wyL4 azIPvYhthN52A== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------jSMM8NSAKkWndRc6Hnzb4J71 Content-Type: multipart/mixed; boundary="------------7P9jVtsG4cIhkqBE0bNZml5i"; protected-headers="v1" From: Maxime Devos To: Nicolas Graves , 57387@debbugs.gnu.org Message-ID: Subject: Re: [bug#57387] [PATCH] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> <87v8qgk7i7.fsf@ngraves.fr> In-Reply-To: <87v8qgk7i7.fsf@ngraves.fr> --------------7P9jVtsG4cIhkqBE0bNZml5i Content-Type: multipart/mixed; boundary="------------PTydeRa6D0H0R7yEqHJ6iI7v" --------------PTydeRa6D0H0R7yEqHJ6iI7v Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 DQpPbiAyNS0wOC0yMDIyIDExOjE2LCBOaWNvbGFzIEdyYXZlcyB2aWEgR3VpeC1wYXRjaGVz IHZpYSB3cm90ZToNCj4gTWFkZSBzdWdnZXN0ZWQgY2hhbmdlcywgcmVwaHJhc2VkIHRoZSBk ZXNjcmlwdGlvbi4NCj4gQnV0IEkgbmV2ZXIgbGVhcm5lZCBDIGFuZCBhbSBub3QgYXQgZWFz ZSBmb3IgYWRkaW5nIGNoZWNrcyBpbiBDIHNvdXJjZQ0KPiBjb2RlLCBzb3JyeS4NCj4NCkkn bGwgZ2l2ZSBpdCBhIHRyeSBteXNlbGYgLi4uDQo= --------------PTydeRa6D0H0R7yEqHJ6iI7v Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------PTydeRa6D0H0R7yEqHJ6iI7v-- --------------7P9jVtsG4cIhkqBE0bNZml5i-- --------------jSMM8NSAKkWndRc6Hnzb4J71 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYwdQGQUDAAAAAAAKCRBJ4+4iGRcl7k5J AP9PGWngPT6c/egXGLW5ZmEA8KkPynwITvLxcs3MMucoOgD8C3T0eBMq+a2/UnsuCQG1A2iUQx5P IbRh7DliDNruZgs= =afL/ -----END PGP SIGNATURE----- --------------jSMM8NSAKkWndRc6Hnzb4J71-- From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Aug 2022 11:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves , 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166142718910735 (code B ref 57387); Thu, 25 Aug 2022 11:34:02 +0000 Received: (at 57387) by debbugs.gnu.org; 25 Aug 2022 11:33:09 +0000 Received: from localhost ([127.0.0.1]:49206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRB6j-0002n5-1I for submit@debbugs.gnu.org; Thu, 25 Aug 2022 07:33:09 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:52694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRB6f-0002mu-K3 for 57387@debbugs.gnu.org; Thu, 25 Aug 2022 07:33:07 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by laurent.telenet-ops.be with bizsmtp id BnZ22800G20ykKC01nZ3aM; Thu, 25 Aug 2022 13:33:04 +0200 Message-ID: Date: Thu, 25 Aug 2022 13:33:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US References: <87czcp8wet.fsf@ngraves.fr> <87v8qgk7i7.fsf@ngraves.fr> From: Maxime Devos In-Reply-To: <87v8qgk7i7.fsf@ngraves.fr> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------un4BBwtYTmoik0Si9krsBAva" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1661427184; bh=WhIHqqsNBFhzHO8+RNFxAcVibhIBhZeDs2DjVkSteio=; h=Date:Subject:To:References:From:In-Reply-To; b=cIwxic9L3x+kaNrskI0/gfa/eGBjvBPpiZKG/e2H1MxlhVaDVjP0ENyfrZ5VA5PbK giXsFSSs/vo2sCdk/j8nloN/TgXE0W572+UxtLblLz2ye0agqisLXRi3onNfjUxTQw G7ojL+FJnq38Wkn4yawWIqQczY1mpinlA5mSK4mFh/MlgeteLkdVT67Dqwr6L5R5X2 Amt5JOpr2f0poHcNesUj4Vr8WNUlbzqgVngbvTqZdLNnsXSwtZ3NDwy5TVGJsLE34F ATCzc2FIlFFyzU9FWuAbU6ISsaqIWS5tT5npEHxs4O9HJIPtZGVpXpzQaFRiSL4eE2 cIN74FAP2K5DA== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------un4BBwtYTmoik0Si9krsBAva Content-Type: multipart/mixed; boundary="------------b0e1BS2J00KL4dk02RmxVGxs"; protected-headers="v1" From: Maxime Devos To: Nicolas Graves , 57387@debbugs.gnu.org Message-ID: Subject: Re: [bug#57387] [PATCH] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> <87v8qgk7i7.fsf@ngraves.fr> In-Reply-To: <87v8qgk7i7.fsf@ngraves.fr> --------------b0e1BS2J00KL4dk02RmxVGxs Content-Type: multipart/mixed; boundary="------------xxJSU55zBr92va2Ou72E0EAX" --------------xxJSU55zBr92va2Ou72E0EAX Content-Type: multipart/alternative; boundary="------------80JK1TcTfKL1iC91JFVoWhcv" --------------80JK1TcTfKL1iC91JFVoWhcv Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 DQpPbiAyNS0wOC0yMDIyIDExOjE2LCBOaWNvbGFzIEdyYXZlcyB2aWEgR3VpeC1wYXRjaGVz IHZpYSB3cm90ZToNCj4gTWFkZSBzdWdnZXN0ZWQgY2hhbmdlcywgcmVwaHJhc2VkIHRoZSBk ZXNjcmlwdGlvbi4NCj4gQnV0IEkgbmV2ZXIgbGVhcm5lZCBDIGFuZCBhbSBub3QgYXQgZWFz ZSBmb3IgYWRkaW5nIGNoZWNrcyBpbiBDIHNvdXJjZQ0KPiBjb2RlLCBzb3JyeS4NCj4NCkkg aGF2ZSBtYWRlIGEgUFIgYXQgPGh0dHBzOi8vZ2l0aHViLmNvbS9hanJheW1vbmQvcmVzdGFy dGQvcHVsbC84PiANCjxodHRwczovL2dpdGh1Yi5jb20vYWpyYXltb25kL3Jlc3RhcnRkL3B1 bGwvOD4gYWRkaW5nIHNvbWUgZXJyb3IgY2hlY2tpbmcuDQoNCkdyZWV0aW5ncywNCk1heGlt ZS4NCg0K --------------80JK1TcTfKL1iC91JFVoWhcv Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On 25-08-2022 11:16, Nicolas Graves vi= a Guix-patches via wrote:
Made suggested changes, rephrased the description.
But I never learned C and am not at ease for adding checks in C source
code, sorry.

I have made a PR at=C2=A0<https:/= /github.com/ajraymond/restartd/pull/8> adding some error checking.

Greetings,
Maxime.

--------------80JK1TcTfKL1iC91JFVoWhcv-- --------------xxJSU55zBr92va2Ou72E0EAX Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------xxJSU55zBr92va2Ou72E0EAX-- --------------b0e1BS2J00KL4dk02RmxVGxs-- --------------un4BBwtYTmoik0Si9krsBAva Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYwdd7QUDAAAAAAAKCRBJ4+4iGRcl7u0b AQCwNbSBizMbVvlr9bdVlutYypntuxHgSRCHlhmKg9HuGwD/chtiapsFbqRKMkz9fClicWJKbGTB qlqg9pKq+lmLTQM= =8cKe -----END PGP SIGNATURE----- --------------un4BBwtYTmoik0Si9krsBAva-- From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> In-Reply-To: <87czcp8wet.fsf@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 Aug 2022 07:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166149913220918 (code B ref 57387); Fri, 26 Aug 2022 07:33:02 +0000 Received: (at 57387) by debbugs.gnu.org; 26 Aug 2022 07:32:12 +0000 Received: from localhost ([127.0.0.1]:51909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRTp5-0005RI-4t for submit@debbugs.gnu.org; Fri, 26 Aug 2022 03:32:12 -0400 Received: from 9.mo575.mail-out.ovh.net ([46.105.78.111]:40833) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRToz-0005R5-Hv for 57387@debbugs.gnu.org; Fri, 26 Aug 2022 03:32:09 -0400 Received: from player756.ha.ovh.net (unknown [10.109.146.86]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id A274524D3C for <57387@debbugs.gnu.org>; Fri, 26 Aug 2022 07:32:03 +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 player756.ha.ovh.net (Postfix) with ESMTPSA id 9BE992D1063CE for <57387@debbugs.gnu.org>; Fri, 26 Aug 2022 07:32:01 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-97G002e563c165-22a8-4355-bbd9-db5f3c31f360, 868EC9C01196D0D87E0B6285E23886C33314C7A5) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 213.44.161.47 From: Nicolas Graves Date: Fri, 26 Aug 2022 09:32:00 +0200 Message-ID: <87r1134g0f.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 8570913044332208837 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejgedguddvvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvufffkfggtgfgsehtqhertddttdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepvefhffelhffhffevtdekvddugffgieefleejtdeuuedtieeifeeujeeiuefhgfeinecuffhomhgrihhnpehgihhthhhusgdrtghomhdplhgruhhntghhphgrugdrnhgvthdpuggvsghirghnrdhorhhgnecukfhppedtrddtrddtrddtpddvudefrdeggedrudeiuddrgeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejheeirdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepheejfeekjeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejhe X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/admin.scm (restartd): New variable. --- gnu/packages/admin.scm | 54 ++++ ...td-add-error-handling-for-robustness.patch | 232 ++++++++++++++++++ .../patches/restartd-fix-compilation.patch | 53 ++++ 3 files changed, 339 insertions(+) create mode 100644 gnu/packages/patches/restartd-add-error-handling-for-ro= bustness.patch create mode 100644 gnu/packages/patches/restartd-fix-compilation.patch diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index a4c5189222..57de594bee 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -51,6 +51,7 @@ ;;; Copyright =C2=A9 2021 Artyom V. Poptsov ;;; Copyright =C2=A9 2022 Wamm K. D. ;;; Copyright =C2=A9 2022 Roman Riabenko +;;; Copyright =C2=A9 2022 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -5455,6 +5456,59 @@ (define-public fail2ban mechanisms if you really want to protect services.") (license license:gpl2+))) +(define-public restartd + (let* ((commit "7044125ac55056f2663536f7137170edf92ebd75") + ;; Version is 0.2.4 in the version file in the repo + ;; but not in github tags. + ;; It is released as 0.2.3-1.1 for other distributions. + ;; Probably because of the lack of activity upstream. + (revision "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 + (search-patches + "restartd-fix-compilation.patch" + "restartd-add-error-handling-for-robustness.patch")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ; no tests + #:make-flags + #~(list (string-append "CC=3D" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda _ + (install-file "restartd.conf" (string-append #$output "/et= c")) + (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 an= d not +running processes. It reads the /proc directory every n seconds and does a +POSIX regexp on the process names. The daemon runs an user-provided script +when it detects a program in the running processes, or an alternate script= if +it doesn't detect the program. 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") diff --git a/gnu/packages/patches/restartd-add-error-handling-for-robustnes= s.patch b/gnu/packages/patches/restartd-add-error-handling-for-robustness.p= atch new file mode 100644 index 0000000000..f0abcf1dac --- /dev/null +++ b/gnu/packages/patches/restartd-add-error-handling-for-robustness.patch @@ -0,0 +1,232 @@ +From ec606eb15091ff8ffa672500413128c29814f8ad Mon Sep 17 00:00:00 2001 +From: Yin Kangkai , Maxime Devos +Date: Thu, 25 Aug 2022 14:29:25 +0200 +Subject: [PATCH] Add some error handling for robustness. + +This makes the code a little more robust. What if /var/run does not +exist, or we do not have permission to open +/var/run/restartd.pid (EPERM?) due to SELinux misconfiguration? +This patch also avoids segmentation fault when run from non-root user. +--- + config.c | 19 ++++++++++---- + config.h | 2 ++ + restartd.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++-------- + 3 files changed, 79 insertions(+), 15 deletions(-) + +diff --git a/config.c b/config.c +index f307b8a..94907e3 100644 +--- a/config.c ++++ b/config.c +@@ -57,7 +57,11 @@ int read_config(void) + config_process_number =3D 0; + + line1 =3D (char *) malloc(MAX_LINE_LENGTH); ++ if (!line1) ++ oom_failure(); + line2 =3D (char *) malloc(MAX_LINE_LENGTH); ++ if (!line2) ++ oom_failure(); + + if ((config_fd =3D fopen(config_file, "rt")) =3D=3D NULL) { + fprintf(stderr, "Error at opening config file: %s\n", config_file= ); +@@ -155,11 +159,16 @@ void dump_config(void) { + int i; + + for(i=3D0; i + * Copyright (C) 2006 Aur=C3=A9lien G=C3=89R=C3=94ME ++ * Copyright (C) 2022 Maxime Devos + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -43,5 +44,6 @@ typedef struct config_process_type { + + int read_config(/* char *config_file */); + void dump_config(void); ++void oom_failure(void); + + #endif /* RESTARTD_CONFIG_H */ +diff --git a/restartd.c b/restartd.c +index 2aa720c..df0a6eb 100644 +--- a/restartd.c ++++ b/restartd.c +@@ -1,6 +1,8 @@ + /* restartd - Process checker and/or restarter daemon + * Copyright (C) 2000-2002 Tibor Koleszar + * Copyright (C) 2006 Aur=C3=A9lien G=C3=89R=C3=94ME ++ * Copyright (C) 2016 Yin Kangkai ++ * Copyright (C) 2022 Maxime Devos + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -52,6 +54,17 @@ void got_signal(int sig) + } + } + ++/* Ignoring out-of-memory failures is risky on systems without virtual me= mory ++ where additionally at address 0 there is actually something important ++ mapped. Additionally, while often on Linux the OOM killer will kill pr= ocesses ++ where an OOM happens, this is not always the case and there exist othe= r systems ++ without an OOM killer (e.g. the Hurd). */ ++void oom_failure() ++{ ++ syslog(LOG_ERR, "Failed to allocate memory. Exiting."); ++ exit(1); ++} ++ + int main(int argc, char *argv[]) + { + DIR *procdir_id; +@@ -75,15 +88,21 @@ int main(int argc, char *argv[]) + + /* Options */ + config_file =3D strdup(DEFAULT_CONFIG); ++ if (!config_file) ++ oom_failure(); ++ + list_only =3D 0; + + for(i =3D 0; i < argc; i++) { + if (!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config")) { + config_file =3D strdup(argv[i + 1]); ++ if (!config_file) ++ oom_failure(); + } + if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { + printf("restard %s - Copyright 2000-2002 Tibor Koleszar \n" +- " Copyright 2006 Aur=C3=A9lien G=C3=89R= =C3=94ME \n", ++ " Copyright 2006 Aur=C3=A9lien G=C3=89R= =C3=94ME \n" ++ " Copyright 2022 Maxime Devos \n", + VERSION); + exit(0); + } +@@ -118,10 +137,13 @@ int main(int argc, char *argv[]) + " -i : the check interval in second\n" + " -l : list configuration options\n" + " -h : help\n\n", VERSION); ++ exit(0); + } + } + + config_process =3D malloc(sizeof(struct config_process_type) * 128); ++ if (!config_process) ++ oom_failure(); + + read_config(); + if (list_only) { +@@ -133,9 +155,17 @@ int main(int argc, char *argv[]) + config_process_number); + + procdir_dirent =3D malloc(sizeof(struct dirent)); ++ if (!procdir_dirent) ++ oom_failure(); + proc_cmdline_str =3D (char *) malloc(1024); ++ if (!proc_cmdline_str) ++ oom_failure(); + proc_cmdline_name =3D (char *) malloc(1024); ++ if (!proc_cmdline_name) ++ oom_failure(); + regc =3D malloc(1024); ++ if (!regc) ++ oom_failure(); + + /* Catch signals */ + signal(SIGTERM, got_signal); +@@ -187,8 +217,18 @@ int main(int argc, char *argv[]) + } + + out_proc =3D fopen("/var/run/restartd.pid", "wt"); +- fprintf(out_proc, "%d", getpid()); +- fclose(out_proc); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd.pid"); ++ return -1; ++ } ++ if (fprintf(out_proc, "%d", getpid()) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting."); ++ return -1; ++ } ++ if (fclose(out_proc) < 0) { /* errors can happen when flushing th= e buffer */ ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting."); ++ return -1; ++ } + + while(1) { + if ((procdir_id =3D opendir("/proc")) =3D=3D NULL) { +@@ -237,16 +277,23 @@ int main(int argc, char *argv[]) + now =3D time(NULL); + + out_proc =3D fopen("/var/run/restartd", "wt"); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd"); ++ return -1; ++ } + +- fprintf(out_proc, "%s\n", ctime(&now)); ++ if (fprintf(out_proc, "%s\n", ctime(&now)) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd. Exiting."); ++ return -1; ++ } + + for(i=3D0; i 0) { + if (strlen(config_process[i].running) > 0) { + strcpy(config_process[i].status, "running"); +- syslog(LOG_INFO, "%s is running, executing '%s'", ++ /* syslog(LOG_INFO, "%s is running, executing '%s'= ", + config_process[i].name, +- config_process[i].running); ++ config_process[i].running); */ + system(config_process[i].running); + } else { + strcpy(config_process[i].status, "running"); +@@ -267,12 +314,18 @@ int main(int argc, char *argv[]) + strcpy(config_process[i].status, "not running"); + } + +- fprintf(out_proc, "%-12s %-12s %s\n", +- config_process[i].name, config_process[i].status, +- config_process[i].processes); ++ if (fprintf(out_proc, "%-12s %-12s %s\n", ++ config_process[i].name, config_process[i].status, ++ config_process[i].processes) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd. Exiting."); ++ return -1; ++ } + } + +- fclose(out_proc); ++ if (fclose(out_proc) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting= ."); ++ return -1; ++ } + + sleep(check_interval); + } +-- +2.37.2 + diff --git a/gnu/packages/patches/restartd-fix-compilation.patch b/gnu/pack= ages/patches/restartd-fix-compilation.patch new file mode 100644 index 0000000000..a380205675 --- /dev/null +++ b/gnu/packages/patches/restartd-fix-compilation.patch @@ -0,0 +1,53 @@ +From 84edc2042bb0a82e65bd4d165b706519886b4075 Mon Sep 17 00:00:00 2001 +From: Sudip Mukherjee +Date: Mon, 10 Aug 2020 19:39:30 +0100 +Subject: [PATCH] Fix build with gcc-10 + +Bug: https://bugs.debian.org/957761 +Signed-off-by: Sudip Mukherjee +--- + config.h | 12 ++++++------ + restartd.c | 7 +++++++ + 2 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/config.h b/config.h +index fabaa2b..a79b28e 100644 +--- a/config.h ++++ b/config.h +@@ -25,12 +25,12 @@ + + #define DEFAULT_CONFIG "/etc/restartd.conf" + +-int debug; +-int config_process_number; +-int check_interval; +-int foreground; +-struct config_process_type *config_process; +-char *config_file; ++extern int debug; ++extern int config_process_number; ++extern int check_interval; ++extern int foreground; ++extern struct config_process_type *config_process; ++extern char *config_file; + + typedef struct config_process_type { + char name[64]; +diff --git a/restartd.c b/restartd.c +index 2aa720c..617b298 100644 +--- a/restartd.c ++++ b/restartd.c +@@ -35,6 +35,13 @@ + + #include "config.h" + ++int debug; ++int config_process_number; ++int check_interval; ++int foreground; ++struct config_process_type *config_process; ++char *config_file; ++ + /* SIGTERM & SIGHUP handler */ + void got_signal(int sig) + { -- 2.37.2 <#secure method=3Dpgpmime mode=3Dsign> -- Best regards, Nicolas Graves From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 Aug 2022 14:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves , 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166152262717522 (code B ref 57387); Fri, 26 Aug 2022 14:04:01 +0000 Received: (at 57387) by debbugs.gnu.org; 26 Aug 2022 14:03:47 +0000 Received: from localhost ([127.0.0.1]:54184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRZw2-0004YY-Na for submit@debbugs.gnu.org; Fri, 26 Aug 2022 10:03:47 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:48278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRZvz-0004YM-Mv for 57387@debbugs.gnu.org; Fri, 26 Aug 2022 10:03:44 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by michel.telenet-ops.be with bizsmtp id CE3h2800D20ykKC06E3hBa; Fri, 26 Aug 2022 16:03:42 +0200 Message-ID: <48ad6a74-1b21-acf8-7f63-6ec86927e47a@telenet.be> Date: Fri, 26 Aug 2022 16:03:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US References: <87czcp8wet.fsf@ngraves.fr> <87r1134g0f.fsf@ngraves.fr> From: Maxime Devos In-Reply-To: <87r1134g0f.fsf@ngraves.fr> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------o8V980VS7pRsowYl8q00f80d" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1661522622; bh=NfgIHxFr5JPcNWka6knhfdJdNx0BJM+Fc8QptS6tO6I=; h=Date:To:References:From:Subject:In-Reply-To; b=XNvZO+apXef8Zk6lXldJfQC/IILwt9XtFqJ/krjzfTZ+/y77aD5D/HPwADgKvXSSu XUyu7H+q1eHtEdMhH0eVWLfDXjj0sk4SPpwT9nGxw/Y7HtAvcgLHEQ1jQws2Mkt+y4 xsqizqqRzVPamvMP2OsOjOtAXgf+4HFu5QXaDqkANVTLTxE8BaLwPoh6hLmpfhma27 1xMLppUkn2sGUlAKZNTsjSnrs181fhGSLVExr2CR/ri2RXtnl3ZtQdaQkfbpEfot+R 9ONM2j1UQsxz83/99AVBo4YuXtb7YKElAnGdGfUl5bS+0rhwcDidv/2r5rQSJ0jMTv p/uYAhewM/3oA== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------o8V980VS7pRsowYl8q00f80d Content-Type: multipart/mixed; boundary="------------biwJ9zeFUliz94T2KSOwtYUZ"; protected-headers="v1" From: Maxime Devos To: Nicolas Graves , 57387@debbugs.gnu.org Message-ID: <48ad6a74-1b21-acf8-7f63-6ec86927e47a@telenet.be> Subject: Re: [bug#57387] [PATCH] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> <87r1134g0f.fsf@ngraves.fr> In-Reply-To: <87r1134g0f.fsf@ngraves.fr> --------------biwJ9zeFUliz94T2KSOwtYUZ Content-Type: multipart/mixed; boundary="------------cqdDt0ErrQJ6c965aWzK10cP" --------------cqdDt0ErrQJ6c965aWzK10cP Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 T24gMjYtMDgtMjAyMiAwOTozMiwgTmljb2xhcyBHcmF2ZXMgdmlhIEd1aXgtcGF0Y2hlcyB2 aWEgd3JvdGU6DQoNCj4gWy4uLl0NCj4gKyAgICAgICAgIChwYXRjaGVzDQo+ICsgICAgICAg ICAgKHNlYXJjaC1wYXRjaGVzDQo+ICsgICAgICAgICAgICJyZXN0YXJ0ZC1maXgtY29tcGls YXRpb24ucGF0Y2giDQo+ICsgICAgICAgICAgICJyZXN0YXJ0ZC1hZGQtZXJyb3ItaGFuZGxp bmctZm9yLXJvYnVzdG5lc3MucGF0Y2giKSkpKQ0KPiBbLi4uXQ0KPiAgIChkZWZpbmUtcHVi bGljIHJleA0KPiAgICAgKHBhY2thZ2UNCj4gICAgICAgKG5hbWUgInJleCIpDQo+IGRpZmYg LS1naXQgYS9nbnUvcGFja2FnZXMvcGF0Y2hlcy9yZXN0YXJ0ZC1hZGQtZXJyb3ItaGFuZGxp bmctZm9yLXJvYnVzdG5lc3MucGF0Y2ggYi9nbnUvcGFja2FnZXMvcGF0Y2hlcy9yZXN0YXJ0 ZC1hZGQtZXJyb3ItaGFuZGxpbmctZm9yLXJvYnVzdG5lc3MucGF0Y2gNCj4gbmV3IGZpbGUg bW9kZSAxMDA2NDQNCj4gaW5kZXggMDAwMDAwMDAwMC4uZjBhYmNmMWRhYw0KPiAtLS0gL2Rl di9udWxsDQo+ICsrKyBiL2dudS9wYWNrYWdlcy9wYXRjaGVzL3Jlc3RhcnRkLWFkZC1lcnJv ci1oYW5kbGluZy1mb3Itcm9idXN0bmVzcy5wYXRjaA0KPiBAQCAtMCwwICsxLDIzMiBAQA0K PiArRnJvbSBlYzYwNmViMTUwOTFmZjhmZmE2NzI1MDA0MTMxMjhjMjk4MTRmOGFkIE1vbiBT ZXAgMTcgMDA6MDA6MDAgMjAwMQ0KPiArRnJvbTogWWluIEthbmdrYWkgPHlpbmthbmdrYWlA eGlhb21pLmNvbT4sIE1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT4NCkEg Yml0IG9mIGEgbml0cGljaywgYnV0IFlpbiBLYWdrYWkgd2FzIG5vdCBpbnZvbHZlZCBpbiB0 aGlzIHBhdGNoLCBJIA0Kd3JvdGUgaXQgbXlzZWxmIC4uLg0KPiArRGF0ZTogVGh1LCAyNSBB dWcgMjAyMiAxNDoyOToyNSArMDIwMA0KPiArU3ViamVjdDogW1BBVENIXSBBZGQgc29tZSBl cnJvciBoYW5kbGluZyBmb3Igcm9idXN0bmVzcy4NCj4gKw0KPiArVGhpcyBtYWtlcyB0aGUg Y29kZSBhIGxpdHRsZSBtb3JlIHJvYnVzdC4gV2hhdCBpZiAvdmFyL3J1biBkb2VzIG5vdA0K PiArZXhpc3QsIG9yIHdlIGRvIG5vdCBoYXZlIHBlcm1pc3Npb24gdG8gb3Blbg0KPiArL3Zh ci9ydW4vcmVzdGFydGQucGlkIChFUEVSTT8pIGR1ZSB0byBTRUxpbnV4IG1pc2NvbmZpZ3Vy YXRpb24/DQo+ICtUaGlzIHBhdGNoIGFsc28gYXZvaWRzIHNlZ21lbnRhdGlvbiBmYXVsdCB3 aGVuIHJ1biBmcm9tIG5vbi1yb290IHVzZXIuDQo+ICstLS0NCj4gK1suLl0NCj4gKyAgICAg ICAgICAgIGZvcihpPTA7IGk8Y29uZmlnX3Byb2Nlc3NfbnVtYmVyOyBpKyspIHsNCj4gKyAg ICAgICAgICAgICAgICBpZiAoc3RybGVuKGNvbmZpZ19wcm9jZXNzW2ldLnByb2Nlc3Nlcykg PiAwKSB7DQo+ICsgICAgICAgICAgICAgICAgICAgIGlmIChzdHJsZW4oY29uZmlnX3Byb2Nl c3NbaV0ucnVubmluZykgPiAwKSB7DQo+ICsgICAgICAgICAgICAgICAgICAgICAgICBzdHJj cHkoY29uZmlnX3Byb2Nlc3NbaV0uc3RhdHVzLCAicnVubmluZyIpOw0KPiArLSAgICAgICAg ICAgICAgICAgICAgICAgc3lzbG9nKExPR19JTkZPLCAiJXMgaXMgcnVubmluZywgZXhlY3V0 aW5nICclcyciLA0KPiArKyAgICAgICAgICAgICAgICAgICAgICAgLyogc3lzbG9nKExPR19J TkZPLCAiJXMgaXMgcnVubmluZywgZXhlY3V0aW5nICclcyciLA0KPiArICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGNvbmZpZ19wcm9jZXNzW2ldLm5hbWUsDQo+ICstICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnX3Byb2Nlc3NbaV0ucnVubmluZyk7DQo+ ICsrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnX3Byb2Nlc3NbaV0ucnVu bmluZyk7ICovDQoNCi4uLiB0aGUgY29tbWVudGluZyBzeXNsb2cgdGhpbmcgd2FzIGFuIHVu cmVsYXRlZCBwYXRjaCwgbWF5YmUgdmFyaW91cyANCmNvbW1pdHMgd2VyZSBzcXVhc2hlZD8N Cg0KV2hlbiBJIHRyaWVkIG91dCB0aGUgcGF0Y2gsIEkgYWRkZWQgYSBsb2NhbCBjb3B5IG9m IA0KaHR0cHM6Ly9wYXRjaC1kaWZmLmdpdGh1YnVzZXJjb250ZW50LmNvbS9yYXcvYWpyYXlt b25kL3Jlc3RhcnRkL3B1bGwvOC5wYXRjaCANCnRvIHRoZSBsaXN0IG9mIHBhdGNoZXMgYW5k ICJndWl4IGJ1aWxkIiBzdWNjZWVkZWQsIHRoZXJlIHdhcyBubyBuZWVkIHRvIA0Kc3F1YXNo IHRoaW5ncy4NCg0KR3JlZXRpbmdzLA0KTWFheGltZS4NCg0KDQo= --------------cqdDt0ErrQJ6c965aWzK10cP Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------cqdDt0ErrQJ6c965aWzK10cP-- --------------biwJ9zeFUliz94T2KSOwtYUZ-- --------------o8V980VS7pRsowYl8q00f80d Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYwjSvQUDAAAAAAAKCRBJ4+4iGRcl7jur AP9FwiZ3ow9QE2aO0BQOfe4EMmTEh3RtxZtzmvBgPdOGjwEA9wbieauOVjyhoUhPAUdFZ/AF+HeQ V/EFuo9q7ZE3PAU= =0F8m -----END PGP SIGNATURE----- --------------o8V980VS7pRsowYl8q00f80d-- From unknown Fri Aug 15 20:51:42 2025 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: Fri, 26 Aug 2022 16:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos , 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166153307213062 (code B ref 57387); Fri, 26 Aug 2022 16:58:02 +0000 Received: (at 57387) by debbugs.gnu.org; 26 Aug 2022 16:57:52 +0000 Received: from localhost ([127.0.0.1]:54438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRceW-0003Oc-Hp for submit@debbugs.gnu.org; Fri, 26 Aug 2022 12:57:52 -0400 Received: from 14.mo561.mail-out.ovh.net ([188.165.43.98]:51777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRceT-0003OQ-HN for 57387@debbugs.gnu.org; Fri, 26 Aug 2022 12:57:51 -0400 Received: from player690.ha.ovh.net (unknown [10.111.172.60]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 6E32B23268 for <57387@debbugs.gnu.org>; Fri, 26 Aug 2022 16:57:47 +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 player690.ha.ovh.net (Postfix) with ESMTPSA id 983702DC8770A; Fri, 26 Aug 2022 16:57:44 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-97G0022c5d71e4-7259-405c-b780-05ca6721a369, 868EC9C01196D0D87E0B6285E23886C33314C7A5) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 213.44.161.47 From: Nicolas Graves In-Reply-To: <48ad6a74-1b21-acf8-7f63-6ec86927e47a@telenet.be> References: <87czcp8wet.fsf@ngraves.fr> <87r1134g0f.fsf@ngraves.fr> <48ad6a74-1b21-acf8-7f63-6ec86927e47a@telenet.be> Date: Fri, 26 Aug 2022 18:57:43 +0200 Message-ID: <87v8qft01k.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 18125299652140917445 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejhedguddtiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffujghffffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepieejgfffffduieevgfduiefhtdfgleejhfdvvefhgeekjeevtdfhtdefleejhefgnecukfhppedtrddtrddtrddtpddvudefrdeggedrudeiuddrgeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrheiledtrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepheejfeekjeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheeiud X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > A bit of a nitpick, but Yin Kagkai was not involved in this patch, I > wrote it myself ... > ... the commenting syslog thing was an unrelated patch, maybe various > commits were squashed? Sorry, I should have explained. Applying both pull requests 6 and 8 failed because 3 lines were common to both. I resolved that by merging both and recreating a new patch, thus giving credit to both authors. Is that OK ? -- Best regards, Nicolas Graves From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 Aug 2022 19:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves , 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166154083026851 (code B ref 57387); Fri, 26 Aug 2022 19:08:01 +0000 Received: (at 57387) by debbugs.gnu.org; 26 Aug 2022 19:07:10 +0000 Received: from localhost ([127.0.0.1]:54548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRefd-0006z1-O4 for submit@debbugs.gnu.org; Fri, 26 Aug 2022 15:07:10 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:52986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRefb-0006ys-Qp for 57387@debbugs.gnu.org; Fri, 26 Aug 2022 15:07:08 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by xavier.telenet-ops.be with bizsmtp id CK732800G20ykKC01K747U; Fri, 26 Aug 2022 21:07:07 +0200 Message-ID: Date: Fri, 26 Aug 2022 21:07:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US References: <87czcp8wet.fsf@ngraves.fr> <87r1134g0f.fsf@ngraves.fr> <48ad6a74-1b21-acf8-7f63-6ec86927e47a@telenet.be> <87v8qft01k.fsf@ngraves.fr> From: Maxime Devos In-Reply-To: <87v8qft01k.fsf@ngraves.fr> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------wtIGBmSQf0BFyaG5EcIf2qnd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1661540827; bh=CjcT7ydWhKJ3nfD6FrAY/aPbLF5WRfX66idoNvpPLQ8=; h=Date:Subject:To:References:From:In-Reply-To; b=Wmg6DOX5BXNWSTWdGIW5gOIx/Bcm20kZqnfnJ9+ycArqbQ8Sdqe1ZVt6UJHxDolnp sA4DZs7spc1rEEV5ULNE7Xu4jS4X1htQ8KQFVl15ATetbfa7H6u4M2HZpEe+QihSUf rINgMNsuI9uCvaSjTj14KtKoQujKOsked0e+TjVmYOZzU550JTwbsF/j58/GA3F49n CBwCgxYRwUB7Qfj2smlzV+BhgYSYiMypNGHQj2VmlGj8TTfYwYvfUYzWjQQ3ki8DaH HV6ojaFhFT2m2XGA5co6nYVNHl29XdAMrrym/lmDpUAK2tLpD77Gv25DmNQZSARcKb Asi2wq22xHSPQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------wtIGBmSQf0BFyaG5EcIf2qnd Content-Type: multipart/mixed; boundary="------------0e9U3kawq7G4j7jhbS5Q5ao3"; protected-headers="v1" From: Maxime Devos To: Nicolas Graves , 57387@debbugs.gnu.org Message-ID: Subject: Re: [bug#57387] [PATCH] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> <87r1134g0f.fsf@ngraves.fr> <48ad6a74-1b21-acf8-7f63-6ec86927e47a@telenet.be> <87v8qft01k.fsf@ngraves.fr> In-Reply-To: <87v8qft01k.fsf@ngraves.fr> --------------0e9U3kawq7G4j7jhbS5Q5ao3 Content-Type: multipart/mixed; boundary="------------4oDIV0VZcSoeRxCCPWptrwDi" --------------4oDIV0VZcSoeRxCCPWptrwDi Content-Type: multipart/alternative; boundary="------------KjBut0ibrrp3Ib0e1sM4ZqMW" --------------KjBut0ibrrp3Ib0e1sM4ZqMW Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 T24gMjYtMDgtMjAyMiAxODo1NywgTmljb2xhcyBHcmF2ZXMgd3JvdGU6DQoNCj4+IEEgYml0 IG9mIGEgbml0cGljaywgYnV0IFlpbiBLYWdrYWkgd2FzIG5vdCBpbnZvbHZlZCBpbiB0aGlz IHBhdGNoLCBJDQo+PiB3cm90ZSBpdCBteXNlbGYgLi4uDQo+PiAuLi4gdGhlIGNvbW1lbnRp bmcgc3lzbG9nIHRoaW5nIHdhcyBhbiB1bnJlbGF0ZWQgcGF0Y2gsIG1heWJlIHZhcmlvdXMN Cj4+IGNvbW1pdHMgd2VyZSBzcXVhc2hlZD8NCj4gU29ycnksIEkgc2hvdWxkIGhhdmUgZXhw bGFpbmVkLg0KPiBBcHBseWluZyBib3RoIHB1bGwgcmVxdWVzdHMgNiBhbmQgOCBmYWlsZWQg YmVjYXVzZSAzIGxpbmVzIHdlcmUgY29tbW9uDQo+IHRvIGJvdGguDQpIbSwgSSBkaWRuJ3Qg ZW5jb3VudGVyIHRoYXQsIG1heWJlIEkgYWNjaWRlbnRhbGx5IHJlbW92ZWQgb25lIG9mIHRo ZSANCnByZS1leGlzdGluZyBwYXRjaGVzIG9yIGV2ZW4gcmVtb3ZlZCBteSBvd24gcGF0Y2gu DQo+IEkgcmVzb2x2ZWQgdGhhdCBieSBtZXJnaW5nIGJvdGggYW5kIHJlY3JlYXRpbmcgYSBu ZXcgcGF0Y2gsIHRodXMgZ2l2aW5nDQo+IGNyZWRpdCB0byBib3RoIGF1dGhvcnMuIElzIHRo YXQgT0sgPw0KDQpPSywgYnV0IHNvbWUgY29tbWl0IG1lc3NhZ2VzIGFyZSBnZXR0aW5nIGxv c3QsIG1heWJlIGFkZCBhIGxpbmsgdG8gdGhlIA0KdHdvIHVwc3RyZWFtIFBScyB0byBtYWtl IGNsZWFyIGl0J3MgYSBjb21iaW5hdGlvbiBvZiBtdWx0aXBsZSANCmluZGVwZW5kZW50IC0t IFlpbiBLYW5na2FpIGRpZCBzb21lIHByZXN1bWFibHkgdXNlZnVsIHRoaW5ncywgYnV0IGl0 J3MgDQpub3QgYWRkaW5nIGVycm9yIGhhbmRsaW5nIHVubGlrZSB3aGF0IHRoZSBjdXJyZW50 IHBhdGNoIG1lc3NhZ2UgYW5kIGZpbGUgDQpuYW1lIGltcGxpZXMuDQoNCkdyZWV0aW5ncywN Ck1heGltZS4NCg0K --------------KjBut0ibrrp3Ib0e1sM4ZqMW Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 26-08-2022 18:57, Nicolas Graves wrote:

A bit of a nitpick, but Yi=
n Kagkai was not involved in this patch, I
wrote it myself ...
=2E.. the commenting syslog thing was an unrelated patch, maybe various
commits were squashed?
Sorry, I should have explain=
ed.
Applying both pull requests 6 and 8 failed because 3 lines were common
to both.
Hm, I didn't encounter that, maybe I accidentally removed one of the pre-existing patches or even removed my own patch.
I resolved that by merging b=
oth and recreating a new patch, thus giving
credit to both authors. Is that OK ?

OK, but some commit messages are getting lost, maybe add a link to the two upstream PRs to make clear it's a combination of multiple independent -- Yin Kangkai did some presumably useful things, but it's not adding error handling unlike what the current patch message and file name implies.

Greetings,
Maxime.

--------------KjBut0ibrrp3Ib0e1sM4ZqMW-- --------------4oDIV0VZcSoeRxCCPWptrwDi Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------4oDIV0VZcSoeRxCCPWptrwDi-- --------------0e9U3kawq7G4j7jhbS5Q5ao3-- --------------wtIGBmSQf0BFyaG5EcIf2qnd Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYwkZ1wUDAAAAAAAKCRBJ4+4iGRcl7r1v AP9w7QqfbTqbvvBzig7FcVyni787WcNG7HE/KRlgoSiQ7QEAxbvaZ4LJRg6Wbt9FevMYUAbW5oCp UBUFw/aozwY98wk= =XEIq -----END PGP SIGNATURE----- --------------wtIGBmSQf0BFyaG5EcIf2qnd-- From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> In-Reply-To: <87czcp8wet.fsf@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 Aug 2022 22:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166155221321518 (code B ref 57387); Fri, 26 Aug 2022 22:17:02 +0000 Received: (at 57387) by debbugs.gnu.org; 26 Aug 2022 22:16:53 +0000 Received: from localhost ([127.0.0.1]:54759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRhdE-0005ay-J9 for submit@debbugs.gnu.org; Fri, 26 Aug 2022 18:16:53 -0400 Received: from 4.mo581.mail-out.ovh.net ([178.32.122.254]:59287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRhd7-0005ah-DN for 57387@debbugs.gnu.org; Fri, 26 Aug 2022 18:16:50 -0400 Received: from player788.ha.ovh.net (unknown [10.111.172.29]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id 54BF725C1E for <57387@debbugs.gnu.org>; Fri, 26 Aug 2022 22:16:43 +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 player788.ha.ovh.net (Postfix) with ESMTPSA id 5D1222DE52787 for <57387@debbugs.gnu.org>; Fri, 26 Aug 2022 22:16:42 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-99G00362105227-d06c-4579-b167-c0379fce1995, 34CB2711DDBD377A9BF43C2AAB695AD3C3B4784F) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 213.44.161.47 From: Nicolas Graves Date: Sat, 27 Aug 2022 00:16:41 +0200 Message-ID: <87a67qsl9y.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 5064860734796784325 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejiedgtdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffufffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeevhffflefhhfffvedtkedvudfggfeifeeljedtueeutdeiieefueejieeuhffgieenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhlrghunhgthhhprggurdhnvghtpdguvggsihgrnhdrohhrghenucfkpheptddrtddrtddrtddpvddufedrgeegrdduiedurdegjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepphhlrgihvghrjeekkedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeehjeefkeejseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkedu X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/admin.scm (restartd): New variable. --- gnu/packages/admin.scm | 54 ++++ ...td-add-error-handling-for-robustness.patch | 242 ++++++++++++++++++ .../patches/restartd-fix-compilation.patch | 53 ++++ 3 files changed, 349 insertions(+) create mode 100644 gnu/packages/patches/restartd-add-error-handling-for-ro= bustness.patch create mode 100644 gnu/packages/patches/restartd-fix-compilation.patch diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index a4c5189222..57de594bee 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -51,6 +51,7 @@ ;;; Copyright =C2=A9 2021 Artyom V. Poptsov ;;; Copyright =C2=A9 2022 Wamm K. D. ;;; Copyright =C2=A9 2022 Roman Riabenko +;;; Copyright =C2=A9 2022 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -5455,6 +5456,59 @@ (define-public fail2ban mechanisms if you really want to protect services.") (license license:gpl2+))) +(define-public restartd + (let* ((commit "7044125ac55056f2663536f7137170edf92ebd75") + ;; Version is 0.2.4 in the version file in the repo + ;; but not in github tags. + ;; It is released as 0.2.3-1.1 for other distributions. + ;; Probably because of the lack of activity upstream. + (revision "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 + (search-patches + "restartd-fix-compilation.patch" + "restartd-add-error-handling-for-robustness.patch")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ; no tests + #:make-flags + #~(list (string-append "CC=3D" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda _ + (install-file "restartd.conf" (string-append #$output "/et= c")) + (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 an= d not +running processes. It reads the /proc directory every n seconds and does a +POSIX regexp on the process names. The daemon runs an user-provided script +when it detects a program in the running processes, or an alternate script= if +it doesn't detect the program. 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") diff --git a/gnu/packages/patches/restartd-add-error-handling-for-robustnes= s.patch b/gnu/packages/patches/restartd-add-error-handling-for-robustness.p= atch new file mode 100644 index 0000000000..33f5f06555 --- /dev/null +++ b/gnu/packages/patches/restartd-add-error-handling-for-robustness.patch @@ -0,0 +1,242 @@ +From ec606eb15091ff8ffa672500413128c29814f8ad Mon Sep 17 00:00:00 2001 +From: Maxime Devos , Yin Kangkai +Date: Thu, 25 Aug 2022 14:29:25 +0200 +Subject: [PATCH] Add some error handling for robustness. + +This patch is a merge of two pull requests for the restartd project. + +Maxime Devos +https://github.com/ajraymond/restartd/pull/8 + +This makes the code a little more robust. What if /var/run does not +exist, or we do not have permission to open +/var/run/restartd.pid (EPERM?) due to SELinux misconfiguration? + +Yin Kangkai +https://github.com/ajraymond/restartd/pull/6 + +This patch also avoids segmentation fault when run from non-root user. + +--- + config.c | 19 ++++++++++---- + config.h | 2 ++ + restartd.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++-------- + 3 files changed, 79 insertions(+), 15 deletions(-) + +diff --git a/config.c b/config.c +index f307b8a..94907e3 100644 +--- a/config.c ++++ b/config.c +@@ -57,7 +57,11 @@ int read_config(void) + config_process_number =3D 0; + + line1 =3D (char *) malloc(MAX_LINE_LENGTH); ++ if (!line1) ++ oom_failure(); + line2 =3D (char *) malloc(MAX_LINE_LENGTH); ++ if (!line2) ++ oom_failure(); + + if ((config_fd =3D fopen(config_file, "rt")) =3D=3D NULL) { + fprintf(stderr, "Error at opening config file: %s\n", config_file= ); +@@ -155,11 +159,16 @@ void dump_config(void) { + int i; + + for(i=3D0; i + * Copyright (C) 2006 Aur=C3=A9lien G=C3=89R=C3=94ME ++ * Copyright (C) 2022 Maxime Devos + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -43,5 +44,6 @@ typedef struct config_process_type { + + int read_config(/* char *config_file */); + void dump_config(void); ++void oom_failure(void); + + #endif /* RESTARTD_CONFIG_H */ +diff --git a/restartd.c b/restartd.c +index 2aa720c..df0a6eb 100644 +--- a/restartd.c ++++ b/restartd.c +@@ -1,6 +1,8 @@ + /* restartd - Process checker and/or restarter daemon + * Copyright (C) 2000-2002 Tibor Koleszar + * Copyright (C) 2006 Aur=C3=A9lien G=C3=89R=C3=94ME ++ * Copyright (C) 2016 Yin Kangkai ++ * Copyright (C) 2022 Maxime Devos + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -52,6 +54,17 @@ void got_signal(int sig) + } + } + ++/* Ignoring out-of-memory failures is risky on systems without virtual me= mory ++ where additionally at address 0 there is actually something important ++ mapped. Additionally, while often on Linux the OOM killer will kill pr= ocesses ++ where an OOM happens, this is not always the case and there exist othe= r systems ++ without an OOM killer (e.g. the Hurd). */ ++void oom_failure() ++{ ++ syslog(LOG_ERR, "Failed to allocate memory. Exiting."); ++ exit(1); ++} ++ + int main(int argc, char *argv[]) + { + DIR *procdir_id; +@@ -75,15 +88,21 @@ int main(int argc, char *argv[]) + + /* Options */ + config_file =3D strdup(DEFAULT_CONFIG); ++ if (!config_file) ++ oom_failure(); ++ + list_only =3D 0; + + for(i =3D 0; i < argc; i++) { + if (!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config")) { + config_file =3D strdup(argv[i + 1]); ++ if (!config_file) ++ oom_failure(); + } + if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { + printf("restard %s - Copyright 2000-2002 Tibor Koleszar \n" +- " Copyright 2006 Aur=C3=A9lien G=C3=89R= =C3=94ME \n", ++ " Copyright 2006 Aur=C3=A9lien G=C3=89R= =C3=94ME \n" ++ " Copyright 2022 Maxime Devos \n", + VERSION); + exit(0); + } +@@ -118,10 +137,13 @@ int main(int argc, char *argv[]) + " -i : the check interval in second\n" + " -l : list configuration options\n" + " -h : help\n\n", VERSION); ++ exit(0); + } + } + + config_process =3D malloc(sizeof(struct config_process_type) * 128); ++ if (!config_process) ++ oom_failure(); + + read_config(); + if (list_only) { +@@ -133,9 +155,17 @@ int main(int argc, char *argv[]) + config_process_number); + + procdir_dirent =3D malloc(sizeof(struct dirent)); ++ if (!procdir_dirent) ++ oom_failure(); + proc_cmdline_str =3D (char *) malloc(1024); ++ if (!proc_cmdline_str) ++ oom_failure(); + proc_cmdline_name =3D (char *) malloc(1024); ++ if (!proc_cmdline_name) ++ oom_failure(); + regc =3D malloc(1024); ++ if (!regc) ++ oom_failure(); + + /* Catch signals */ + signal(SIGTERM, got_signal); +@@ -187,8 +217,18 @@ int main(int argc, char *argv[]) + } + + out_proc =3D fopen("/var/run/restartd.pid", "wt"); +- fprintf(out_proc, "%d", getpid()); +- fclose(out_proc); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd.pid"); ++ return -1; ++ } ++ if (fprintf(out_proc, "%d", getpid()) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting."); ++ return -1; ++ } ++ if (fclose(out_proc) < 0) { /* errors can happen when flushing th= e buffer */ ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting."); ++ return -1; ++ } + + while(1) { + if ((procdir_id =3D opendir("/proc")) =3D=3D NULL) { +@@ -237,16 +277,23 @@ int main(int argc, char *argv[]) + now =3D time(NULL); + + out_proc =3D fopen("/var/run/restartd", "wt"); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd"); ++ return -1; ++ } + +- fprintf(out_proc, "%s\n", ctime(&now)); ++ if (fprintf(out_proc, "%s\n", ctime(&now)) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd. Exiting."); ++ return -1; ++ } + + for(i=3D0; i 0) { + if (strlen(config_process[i].running) > 0) { + strcpy(config_process[i].status, "running"); +- syslog(LOG_INFO, "%s is running, executing '%s'", ++ /* syslog(LOG_INFO, "%s is running, executing '%s'= ", + config_process[i].name, +- config_process[i].running); ++ config_process[i].running); */ + system(config_process[i].running); + } else { + strcpy(config_process[i].status, "running"); +@@ -267,12 +314,18 @@ int main(int argc, char *argv[]) + strcpy(config_process[i].status, "not running"); + } + +- fprintf(out_proc, "%-12s %-12s %s\n", +- config_process[i].name, config_process[i].status, +- config_process[i].processes); ++ if (fprintf(out_proc, "%-12s %-12s %s\n", ++ config_process[i].name, config_process[i].status, ++ config_process[i].processes) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd. Exiting."); ++ return -1; ++ } + } + +- fclose(out_proc); ++ if (fclose(out_proc) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting= ."); ++ return -1; ++ } + + sleep(check_interval); + } +-- +2.37.2 + diff --git a/gnu/packages/patches/restartd-fix-compilation.patch b/gnu/pack= ages/patches/restartd-fix-compilation.patch new file mode 100644 index 0000000000..a380205675 --- /dev/null +++ b/gnu/packages/patches/restartd-fix-compilation.patch @@ -0,0 +1,53 @@ +From 84edc2042bb0a82e65bd4d165b706519886b4075 Mon Sep 17 00:00:00 2001 +From: Sudip Mukherjee +Date: Mon, 10 Aug 2020 19:39:30 +0100 +Subject: [PATCH] Fix build with gcc-10 + +Bug: https://bugs.debian.org/957761 +Signed-off-by: Sudip Mukherjee +--- + config.h | 12 ++++++------ + restartd.c | 7 +++++++ + 2 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/config.h b/config.h +index fabaa2b..a79b28e 100644 +--- a/config.h ++++ b/config.h +@@ -25,12 +25,12 @@ + + #define DEFAULT_CONFIG "/etc/restartd.conf" + +-int debug; +-int config_process_number; +-int check_interval; +-int foreground; +-struct config_process_type *config_process; +-char *config_file; ++extern int debug; ++extern int config_process_number; ++extern int check_interval; ++extern int foreground; ++extern struct config_process_type *config_process; ++extern char *config_file; + + typedef struct config_process_type { + char name[64]; +diff --git a/restartd.c b/restartd.c +index 2aa720c..617b298 100644 +--- a/restartd.c ++++ b/restartd.c +@@ -35,6 +35,13 @@ + + #include "config.h" + ++int debug; ++int config_process_number; ++int check_interval; ++int foreground; ++struct config_process_type *config_process; ++char *config_file; ++ + /* SIGTERM & SIGHUP handler */ + void got_signal(int sig) + { -- 2.37.2 -- Best regards, Nicolas Graves From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 28 Aug 2022 17:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves , 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166170834220640 (code B ref 57387); Sun, 28 Aug 2022 17:40:01 +0000 Received: (at 57387) by debbugs.gnu.org; 28 Aug 2022 17:39:02 +0000 Received: from localhost ([127.0.0.1]:59599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSMFS-0005Mq-6s for submit@debbugs.gnu.org; Sun, 28 Aug 2022 13:39:02 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:47230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSMFP-0005MQ-RR for 57387@debbugs.gnu.org; Sun, 28 Aug 2022 13:39:00 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by baptiste.telenet-ops.be with bizsmtp id D5ew2800C20ykKC015ewz2; Sun, 28 Aug 2022 19:38:58 +0200 Message-ID: <0facd90b-ed19-711a-26d0-e393ddee097d@telenet.be> Date: Sun, 28 Aug 2022 19:38:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US References: <87czcp8wet.fsf@ngraves.fr> <87a67qsl9y.fsf@ngraves.fr> From: Maxime Devos In-Reply-To: <87a67qsl9y.fsf@ngraves.fr> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------2iX5CXdDIgjqTHlk3y9OykOV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1661708338; bh=wMxZHtJxlaNeUbSeTJUuVJfZJHAppf38XJJD8PcAj48=; h=Date:Subject:To:References:From:In-Reply-To; b=aZMtM0bvb3WEGMTM1MA8kd/+pTQiQXthlpcp25zQhnx1D13YAKwYHq4i9yWrDRjp2 Mgf7DgSoIVlWcVvDhSoW2OrjeYWQtsJRIWqN2oYgWTamBgEQKthd9nPz/92V3Nk9/Q KrCshKIKbeNYS6CwLLD1FU0BiNC443kGKJFns7doF1AIUn1ZfcD+jTlUNKDPySaSOq 2aG79+vK0KzLiNFj4T2V/1Nxswu/qOTMPq/zy5K9oPMhhtMdPxEqG1rmjtUjSzoUO5 phFG6K1dpXjs15snGeneZOuBPK1xusavODfYnKquQkmHDRBrMjB7m+d4rX/dTZhstx qqLb7KS/hGzYQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------2iX5CXdDIgjqTHlk3y9OykOV Content-Type: multipart/mixed; boundary="------------LIj0R0i9Gd84ZJS6tOb6ws7X"; protected-headers="v1" From: Maxime Devos To: Nicolas Graves , 57387@debbugs.gnu.org Message-ID: <0facd90b-ed19-711a-26d0-e393ddee097d@telenet.be> Subject: Re: [bug#57387] [PATCH] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> <87a67qsl9y.fsf@ngraves.fr> In-Reply-To: <87a67qsl9y.fsf@ngraves.fr> --------------LIj0R0i9Gd84ZJS6tOb6ws7X Content-Type: multipart/mixed; boundary="------------K0waoYsovoZ2EjVUQFaitIAL" --------------K0waoYsovoZ2EjVUQFaitIAL Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 VGhpcyBtZXJnZSBzZWVtcyBvayB0byBtZS4NCg0KVGhhbmtzLA0KTWF4aW1lIChub3QgYSBj b21taXR0ZXIpDQo= --------------K0waoYsovoZ2EjVUQFaitIAL Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------K0waoYsovoZ2EjVUQFaitIAL-- --------------LIj0R0i9Gd84ZJS6tOb6ws7X-- --------------2iX5CXdDIgjqTHlk3y9OykOV Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYwuoMAUDAAAAAAAKCRBJ4+4iGRcl7q+c AQCHnLFZs+7iWKCnFroLmTxWpKiRs/wyMDahzD0O0geq/AEAnnhEEY9EbtC7ntVMrfdbjmvBHk2b PzYcQR04K4FZHQY= =RW2U -----END PGP SIGNATURE----- --------------2iX5CXdDIgjqTHlk3y9OykOV-- From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Sep 2022 14:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves Cc: 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.16629080418754 (code B ref 57387); Sun, 11 Sep 2022 14:55:02 +0000 Received: (at 57387) by debbugs.gnu.org; 11 Sep 2022 14:54:01 +0000 Received: from localhost ([127.0.0.1]:43158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXOLR-0002H0-0t for submit@debbugs.gnu.org; Sun, 11 Sep 2022 10:54:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXOLP-0002Gf-5E for 57387@debbugs.gnu.org; Sun, 11 Sep 2022 10:53:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXOLI-0008Ne-Mz; Sun, 11 Sep 2022 10:53:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=jiyvxlW6bmByOumXTJ5TDsISapKTlRWBjoRi/ZUAVoU=; b=Nt3CQ/jpnZxHrWcZZYYi UHMRfrfiUHBTzWCMsdwc8EQQB7QE6SK8v/xd1RtFQwk6kT7ufxCS7DKxRo8yOdGvpx7Xc/ktsNZrM gwnWeEMEQ2c0yrZKBkSV/OSohajOynqkrr4H12BPwwbBQ0aXkuldu33NFFRd1PjZR+Kp4tTdV4HB5 V7X0c56TUc+6GMDxGCpJOSQY84nWzpKdfYbCUX98cySjsLPGs7SK+FwE7NsDaMbVXhmjun6s4uvZM q/fyfhRntaxUqD6W8Mzm6KgrrTr2O3g/po9K5U7a39cldl52iW935B2bxSNbxj9uZQXd601AnJBMW ZQBeQKu1kPqpKQ==; Received: from [2a02:587:1d33:7300:4fa4:945e:237e:7b1f] (port=58676 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXOLH-0004IJ-P7; Sun, 11 Sep 2022 10:53:52 -0400 From: Mathieu Othacehe References: <87czcp8wet.fsf@ngraves.fr> <87a67qsl9y.fsf@ngraves.fr> Date: Sun, 11 Sep 2022 16:53:49 +0200 In-Reply-To: <87a67qsl9y.fsf@ngraves.fr> (Nicolas Graves's message of "Sat, 27 Aug 2022 00:16:41 +0200") Message-ID: <87sfkyynb6.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello, > * gnu/packages/admin.scm (restartd): New variable. I have the following error when trying to build the package: --8<---------------cut here---------------start------------->8--- 2 out of 8 hunks FAILED -- saving rejects to file restartd.c.rej source is at 'restartd-0.2.3-1.7044125-checkout' applying '/gnu/store/gayczr3cvcxlqafxz9pclk6b8jhxhl75-restartd-fix-compilat= ion.patch'... applying '/gnu/store/d1sllhia0ninbfrq9agw2272dwm1v103-restartd-add-error-ha= ndling-for-robustness.patch'... Backtrace: 5 (primitive-load "/gnu/store/skbm6f65x56bhq5sd8w7fys5q49=E2=80= =A6") In ice-9/eval.scm: 619:8 4 (_ #(#(# "res=E2=80=A6") = #)) In ice-9/boot-9.scm: 142:2 3 (dynamic-wind # =E2=80=A6) In ice-9/eval.scm: 619:8 2 (_ #(#(#))) In srfi/srfi-1.scm: 634:9 1 (for-each # _) In guix/build/utils.scm: 762:6 0 (invoke "/gnu/store/z39hnrwds1dgcbpfgj8dnv2cngjb2xbl-p=E2=80= =A6" =E2=80=A6) guix/build/utils.scm:762:6: In procedure invoke: ERROR: 1. &invoke-error: program: "/gnu/store/z39hnrwds1dgcbpfgj8dnv2cngjb2xbl-patch-2.7.6/bin= /patch" arguments: ("--force" "--no-backup-if-mismatch" "-p1" "--input" "/gnu= /store/d1sllhia0ninbfrq9agw2272dwm1v103-restartd-add-error-handling-for-rob= ustness.patch") exit-status: 1 term-signal: #f stop-signal: #f --8<---------------cut here---------------end--------------->8--- Mathieu From unknown Fri Aug 15 20:51:42 2025 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: Sun, 11 Sep 2022 18:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.16629200035509 (code B ref 57387); Sun, 11 Sep 2022 18:14:01 +0000 Received: (at 57387) by debbugs.gnu.org; 11 Sep 2022 18:13:23 +0000 Received: from localhost ([127.0.0.1]:43383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXRSN-0001Qm-Db for submit@debbugs.gnu.org; Sun, 11 Sep 2022 14:13:23 -0400 Received: from 19.mo581.mail-out.ovh.net ([178.33.251.118]:51247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXRSK-0001Qd-K5 for 57387@debbugs.gnu.org; Sun, 11 Sep 2022 14:13:21 -0400 Received: from player695.ha.ovh.net (unknown [10.109.156.6]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id 95FE021365 for <57387@debbugs.gnu.org>; Sun, 11 Sep 2022 18:13:18 +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 player695.ha.ovh.net (Postfix) with ESMTPSA id 143662E51D82F; Sun, 11 Sep 2022 18:13:14 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-105G00648d697be-b9a7-4549-b479-4a5f0bf16654, DECAE4C5681F39FBFD41AF98CA22D585DED06606) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 213.44.161.47 From: Nicolas Graves In-Reply-To: <87sfkyynb6.fsf_-_@gnu.org> References: <87czcp8wet.fsf@ngraves.fr> <87a67qsl9y.fsf@ngraves.fr> <87sfkyynb6.fsf_-_@gnu.org> Date: Sun, 11 Sep 2022 20:13:14 +0200 Message-ID: <871qshlqyt.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 2683300954707714757 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfedutddguddviecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhffkfggtgesthdtredttddttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeevkeelueejtdehgfffkeelkefhhffftefgvdehkeeluefhheeuleejtdejhfdvgfenucfkpheptddrtddrtddrtddpvddufedrgeegrdduiedurdegjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepphhlrgihvghrieelhedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeehjeefkeejseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkedu X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2022-09-11 16:53, Mathieu Othacehe wrote: > I have the following error when trying to build the package: > > --8<---------------cut here---------------start------------->8--- > 2 out of 8 hunks FAILED -- saving rejects to file restartd.c.rej I can't reproduce, don't have the error when compiling again with --check. Can you provide contents of restartd.c.rej? Thanks! Nicolas -- Best regards, Nicolas Graves From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Sep 2022 07:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves Cc: 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166296818527017 (code B ref 57387); Mon, 12 Sep 2022 07:37:01 +0000 Received: (at 57387) by debbugs.gnu.org; 12 Sep 2022 07:36:25 +0000 Received: from localhost ([127.0.0.1]:44015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXdzV-00071h-De for submit@debbugs.gnu.org; Mon, 12 Sep 2022 03:36:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXdzS-00071R-UF for 57387@debbugs.gnu.org; Mon, 12 Sep 2022 03:36:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXdzM-0007kI-A1; Mon, 12 Sep 2022 03:36:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=3oS4XPecLtRR2rRP1Y/S5JMfjhdjg/CUOcevr1huD4E=; b=cLGmQxqJo0QyaNs9Ypho RGDAodLE6IgDe11UbyxgayMcCKJTr3qJ8RY4LXLrYQWlKkfEZtqgXG8Pea4lAy7HV96W47CptbUIz bySd16eeIZvAaVG67PNss4CEaQ/VZI70tgLiViM9bnNi5Y7ihuAHjRxwBsjPC+yBkND4CpWEIt12L F5jS5FBs9UkfPbg5Me3z63FpEbThacD337FITPhyXCv0vCCMPX4crmQ1Q6fD4VFdDVWGFzBX7loci uZ86nbPcmbf3644DWGk8geOolosoQjhuaN1RgJXa9DzgU+Z7JBautr7m1MWZw9QwS+cQ0vZZ0gBo4 5lNj1vWNrMjVug==; Received: from [2a02:587:1d33:7300:4fa4:945e:237e:7b1f] (port=33654 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXdzL-0007s2-PL; Mon, 12 Sep 2022 03:36:16 -0400 From: Mathieu Othacehe References: <87czcp8wet.fsf@ngraves.fr> <87a67qsl9y.fsf@ngraves.fr> <87sfkyynb6.fsf_-_@gnu.org> <871qshlqyt.fsf@ngraves.fr> Date: Mon, 12 Sep 2022 09:36:13 +0200 In-Reply-To: <871qshlqyt.fsf@ngraves.fr> (Nicolas Graves's message of "Sun, 11 Sep 2022 20:13:14 +0200") Message-ID: <87y1up9h8y.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Hello, > I can't reproduce, don't have the error when compiling again with > --check. Can you provide contents of restartd.c.rej? Please find it attached. Mathieu --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=restartd.c.rej Content-Transfer-Encoding: base64 LS0tIHJlc3RhcnRkLmMKKysrIHJlc3RhcnRkLmMKQEAgLTEzNywxMCArMTU2LDEzIEBAIGludCBt YWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCiAgICAgICAgICAgICAgICAgICAgICIgIC1pIDxp bnRlcnZhbF9zZWM+OiB0aGUgY2hlY2sgaW50ZXJ2YWwgaW4gc2Vjb25kXG4iCiAgICAgICAgICAg ICAgICAgICAgICIgIC1sICAgICAgICAgICAgICAgOiBsaXN0IGNvbmZpZ3VyYXRpb24gb3B0aW9u c1xuIgogICAgICAgICAgICAgICAgICAgICAiICAtaCAgICAgICAgICAgICAgIDogaGVscFxuXG4i LCBWRVJTSU9OKTsKKwkgICAgZXhpdCgwKTsKICAgICAgICAgfQogICAgIH0KIAogICAgIGNvbmZp Z19wcm9jZXNzID0gbWFsbG9jKHNpemVvZihzdHJ1Y3QgY29uZmlnX3Byb2Nlc3NfdHlwZSkgKiAx MjgpOworICAgIGlmICghY29uZmlnX3Byb2Nlc3MpCisgICAgICBvb21fZmFpbHVyZSgpOwogCiAg ICAgcmVhZF9jb25maWcoKTsKICAgICBpZiAobGlzdF9vbmx5KSB7CkBAIC0xNTIsOSArMTc0LDE3 IEBAIGludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCiAgICAgICAgICAgIGNvbmZpZ19w cm9jZXNzX251bWJlcik7CiAKICAgICBwcm9jZGlyX2RpcmVudCA9IG1hbGxvYyhzaXplb2Yoc3Ry dWN0IGRpcmVudCkpOworICAgIGlmICghcHJvY2Rpcl9kaXJlbnQpCisgICAgICBvb21fZmFpbHVy ZSgpOwogICAgIHByb2NfY21kbGluZV9zdHIgPSAoY2hhciAqKSBtYWxsb2MoMTAyNCk7CisgICAg aWYgKCFwcm9jX2NtZGxpbmVfc3RyKQorICAgICAgb29tX2ZhaWx1cmUoKTsKICAgICBwcm9jX2Nt ZGxpbmVfbmFtZSA9IChjaGFyICopIG1hbGxvYygxMDI0KTsKKyAgICBpZiAoIXByb2NfY21kbGlu ZV9uYW1lKQorICAgICAgb29tX2ZhaWx1cmUoKTsKICAgICByZWdjID0gbWFsbG9jKDEwMjQpOwor ICAgIGlmICghcmVnYykKKyAgICAgIG9vbV9mYWlsdXJlKCk7CiAKICAgICAvKiBDYXRjaCBzaWdu YWxzICovCiAgICAgc2lnbmFsKFNJR1RFUk0sIGdvdF9zaWduYWwpOwo= --=-=-=-- From unknown Fri Aug 15 20:51:42 2025 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: Tue, 13 Sep 2022 09:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166305994819288 (code B ref 57387); Tue, 13 Sep 2022 09:06:02 +0000 Received: (at 57387) by debbugs.gnu.org; 13 Sep 2022 09:05:48 +0000 Received: from localhost ([127.0.0.1]:48789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY1rX-000512-Vy for submit@debbugs.gnu.org; Tue, 13 Sep 2022 05:05:48 -0400 Received: from 12.mo561.mail-out.ovh.net ([188.165.41.191]:44645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY1rV-00050t-IX for 57387@debbugs.gnu.org; Tue, 13 Sep 2022 05:05:46 -0400 Received: from player772.ha.ovh.net (unknown [10.109.143.183]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 3E44422186 for <57387@debbugs.gnu.org>; Tue, 13 Sep 2022 09:05:22 +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 player772.ha.ovh.net (Postfix) with ESMTPSA id A338E2E88B8E6; Tue, 13 Sep 2022 08:45:55 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-98R0026a3106c9-4333-4ffd-8c1c-d6a822e93f23, 2C29F6F9EF66A0E2782F7CEADBC5EBE58685C6A1) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 213.44.161.47 From: Nicolas Graves In-Reply-To: <87y1up9h8y.fsf@gnu.org> References: <87czcp8wet.fsf@ngraves.fr> <87a67qsl9y.fsf@ngraves.fr> <87sfkyynb6.fsf_-_@gnu.org> <871qshlqyt.fsf@ngraves.fr> <87y1up9h8y.fsf@gnu.org> Date: Tue, 13 Sep 2022 10:45:54 +0200 Message-ID: <87sfkvvf0d.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 4847280574885126853 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfedugedguddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepveekleeujedthefgffekleekhffhffetgfdvheekleeuhfehueeljedtjefhvdfgnecukfhppeduvdejrddtrddtrddupddvudefrdeggedrudeiuddrgeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeehjeefkeejseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Please find it attached. Thanks! I don't understand why there should be a reject, just by looking at the patches, I don't see why these hunks would collide. I don't have a clue on how to fix this. I'll merge both locally and regenerating a single patch that by definition can't collide. -- Best regards, Nicolas Graves From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH] gnu: Add restartd. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 14 Sep 2022 07:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves Cc: 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166314169518910 (code B ref 57387); Wed, 14 Sep 2022 07:49:02 +0000 Received: (at 57387) by debbugs.gnu.org; 14 Sep 2022 07:48:15 +0000 Received: from localhost ([127.0.0.1]:53587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYN82-0004uw-Qc for submit@debbugs.gnu.org; Wed, 14 Sep 2022 03:48:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYN81-0004uk-SY for 57387@debbugs.gnu.org; Wed, 14 Sep 2022 03:48:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYN7v-0008FQ-A9; Wed, 14 Sep 2022 03:48:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=zfWWby30d6pVmYdI8b8luM/LRGOgtnMCDbId7veNYyo=; b=GPUz/TeBp4PGHHIkEpmt 1wMn/Ezf6mcfxzrXs0pdDJcwaEipxo1r9OzQMOF2KXXw6y/zMrFUO87Hge9myfFGw3fnyLn8T/1AR 6d1jmqBJPrLZx7pYnknj30ZJwB6Jwmh9biRydUw0f9zEXaz8uSyinuq8OwkEDFqEnPfw+zOMUKihq 4rLKG+CueN/OzB+8zrUZhbXWZIdum8dKY/cx134NnS+VmlJ1k2hhgP0oVeMT7EO+92g+IdR0Jl/rC 3RyNRy06nnBJhGxRx1w+dHLUDBBOVwiQasj30NBi1JE9i7rLNWn/fC0BW+1VhyWAKA7Vf99WsDiO0 Qv3r4670oOrLuw==; Received: from [195.167.26.149] (port=39344 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYN7u-0005BG-MX; Wed, 14 Sep 2022 03:48:07 -0400 From: Mathieu Othacehe References: <87czcp8wet.fsf@ngraves.fr> <87a67qsl9y.fsf@ngraves.fr> Date: Wed, 14 Sep 2022 09:48:04 +0200 In-Reply-To: <87a67qsl9y.fsf@ngraves.fr> (Nicolas Graves's message of "Sat, 27 Aug 2022 00:16:41 +0200") Message-ID: <875yhqcs7f.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Nicolas, > ...td-add-error-handling-for-robustness.patch | 242 ++++++++++++++++++ > .../patches/restartd-fix-compilation.patch | 53 ++++ Both patches also need to be added to the dist_patch_DATA variable of gnu/local.mk. Thanks, Mathieu From unknown Fri Aug 15 20:51:42 2025 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: Thu, 29 Sep 2022 13:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57387@debbugs.gnu.org Cc: othacehe@gnu.org, maximedevos@telenet.be Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.166445728917191 (code B ref 57387); Thu, 29 Sep 2022 13:15:01 +0000 Received: (at 57387) by debbugs.gnu.org; 29 Sep 2022 13:14:49 +0000 Received: from localhost ([127.0.0.1]:36607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odtNI-0004TC-Ku for submit@debbugs.gnu.org; Thu, 29 Sep 2022 09:14:49 -0400 Received: from 4.mo560.mail-out.ovh.net ([87.98.172.75]:47777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odtND-0004Sz-Qw for 57387@debbugs.gnu.org; Thu, 29 Sep 2022 09:14:47 -0400 Received: from player746.ha.ovh.net (unknown [10.111.172.14]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id DA2B4260CC for <57387@debbugs.gnu.org>; Thu, 29 Sep 2022 13:14:41 +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 player746.ha.ovh.net (Postfix) with ESMTPSA id 8048B21C37614; Thu, 29 Sep 2022 13:14:38 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-110S004014f438b-0570-4438-930c-3095c38b2eef, B0E8D5270CD01EFF20DD9E8B4F81152F34611B42) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 213.44.161.47 From: Nicolas Graves In-Reply-To: <87edvu1hy9.fsf@ngraves.fr> References: <87edvu1hy9.fsf@ngraves.fr> Date: Thu, 29 Sep 2022 15:14:35 +0200 Message-ID: <87pmfez5j8.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 11115165357162422798 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfeehtddgieefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufgjfhffkfggtgfgsehtqhertddttdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnheptdelfeegtdevueefhfefveeutdekleeuffevgedugeeugedvjedvfeevtdevffevnecuffhomhgrihhnpehgihhthhhusgdrtghomhdplhgruhhntghhphgrugdrnhgvthdpuggvsghirghnrdhorhhgnecukfhppedtrddtrddtrddtpddvudefrdeggedrudeiuddrgeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejgeeirdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepheejfeekjeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheeitd X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/admin.scm (restartd): New variable. --- gnu/packages/admin.scm | 51 +++ .../patches/restartd-update-robust.patch | 295 ++++++++++++++++++ 2 files changed, 346 insertions(+) create mode 100644 gnu/packages/patches/restartd-update-robust.patch diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 1a213adfdd..c696384211 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -53,6 +53,7 @@ ;;; Copyright =C2=A9 2022 Roman Riabenko ;;; Copyright =C2=A9 2022 Petr Hodina ;;; Copyright =C2=A9 2022 Andreas Rammhold +;;; Copyright =C2=A9 2022 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -5489,6 +5490,56 @@ (define-public fail2ban mechanisms if you really want to protect services.") (license license:gpl2+))) =20 +(define-public restartd + (let* ((commit "7044125ac55056f2663536f7137170edf92ebd75") + ;; Version is 0.2.4 in the version file in the repo + ;; but not in github tags. + ;; It is released as 0.2.3-1.1 for other distributions. + ;; Probably because of the lack of activity upstream. + (revision "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 (search-patches "restartd-update-robust.patch")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ; no tests + #:make-flags + #~(list (string-append "CC=3D" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda _ + (install-file "restartd.conf" (string-append #$output "/et= c")) + (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 an= d not +running processes. It reads the /proc directory every n seconds and does a +POSIX regexp on the process names. The daemon runs an user-provided script +when it detects a program in the running processes, or an alternate script= if +it doesn't detect the program. 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") diff --git a/gnu/packages/patches/restartd-update-robust.patch b/gnu/packag= es/patches/restartd-update-robust.patch new file mode 100644 index 0000000000..d279ebd8ff --- /dev/null +++ b/gnu/packages/patches/restartd-update-robust.patch @@ -0,0 +1,295 @@ +From 01cd2d15a9bf1109e0e71b3e31b835d63dcf9cd8 Mon Sep 17 00:00:00 2001 +From: Maxime Devos , Yin Kangkai , Sudip Mukherjee +Subject: [PATCH] + +Fix segfault when run as normal user + +Also exit immediately when "restartd -h" +Signed-off-by: Yin Kangkai + +Fix build with gcc-10 + +Bug: https://bugs.debian.org/957761 +Signed-off-by: Sudip Mukherjee + +Handle memory allocation failures. + +This makes the code a little more robust. +Signed-off-by: Maxime Devos + +Handle fopen failures. + +This makes the code a little more robust. What if /var/run does not +exist, or we do not have permission to open +/var/run/restartd.pid (EPERM?) due to SELinux misconfiguration? +Signed-off-by: Maxime Devos + +Handle printf and fprintf failures. + +This makes the code a little more robust. What if the write was +refused to the underlying device being removed? + +The --help, debug and stderr printfs were ignored because there error +handling does not appear important to me. +Signed-off-by: Maxime Devos + +Handle fclose failures when writing. + +This makes the code a little more robust. What if a quotum is exceeded? +Signed-off-by: Maxime Devos +--- + config.c | 19 +++++++++---- + config.h | 14 ++++++---- + restartd.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++------- + 3 files changed, 92 insertions(+), 21 deletions(-) + +diff --git a/config.c b/config.c +index f307b8a..5cc0271 100644 +--- a/config.c ++++ b/config.c +@@ -57,7 +57,11 @@ int read_config(void) + config_process_number =3D 0; +=20 + line1 =3D (char *) malloc(MAX_LINE_LENGTH); ++ if (!line1) ++ oom_failure(); + line2 =3D (char *) malloc(MAX_LINE_LENGTH); ++ if (!line2) ++ oom_failure(); +=20 + if ((config_fd =3D fopen(config_file, "rt")) =3D=3D NULL) { + fprintf(stderr, "Error at opening config file: %s\n", config_file= ); +@@ -155,11 +159,16 @@ void dump_config(void) { + int i; +=20 + for(i=3D0; i + * Copyright (C) 2006 Aur=C3=A9lien G=C3=89R=C3=94ME ++ * Copyright (C) 2022 Maxime Devos + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -25,12 +26,12 @@ +=20 + #define DEFAULT_CONFIG "/etc/restartd.conf" +=20 +-int debug; +-int config_process_number; +-int check_interval; +-int foreground; +-struct config_process_type *config_process; +-char *config_file; ++extern int debug; ++extern int config_process_number; ++extern int check_interval; ++extern int foreground; ++extern struct config_process_type *config_process; ++extern char *config_file; +=20 + typedef struct config_process_type { + char name[64]; +@@ -43,5 +44,6 @@ typedef struct config_process_type { +=20 + int read_config(/* char *config_file */); + void dump_config(void); ++void oom_failure(void); +=20 + #endif /* RESTARTD_CONFIG_H */ +diff --git a/restartd.c b/restartd.c +index 2aa720c..aa74334 100644 +--- a/restartd.c ++++ b/restartd.c +@@ -1,6 +1,7 @@ + /* restartd - Process checker and/or restarter daemon + * Copyright (C) 2000-2002 Tibor Koleszar + * Copyright (C) 2006 Aur=C3=A9lien G=C3=89R=C3=94ME ++ * Copyright (C) 2022 Maxime Devos + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -35,6 +36,13 @@ +=20 + #include "config.h" +=20 ++int debug; ++int config_process_number; ++int check_interval; ++int foreground; ++struct config_process_type *config_process; ++char *config_file; ++ + /* SIGTERM & SIGHUP handler */ + void got_signal(int sig) + { +@@ -52,6 +60,17 @@ void got_signal(int sig) + } + } +=20 ++/* Ignoring out-of-memory failures is risky on systems without virtual me= mory ++ where additionally at address 0 there is actually something important ++ mapped. Additionally, while often on Linux the OOM killer will kill pr= ocesses ++ where an OOM happens, this is not always the case and there exist othe= r systems ++ without an OOM killer (e.g. the Hurd). */ ++void oom_failure() ++{ ++ syslog(LOG_ERR, "Failed to allocate memory. Exiting."); ++ exit(1); ++} ++ + int main(int argc, char *argv[]) + { + DIR *procdir_id; +@@ -75,15 +94,21 @@ int main(int argc, char *argv[]) +=20 + /* Options */ + config_file =3D strdup(DEFAULT_CONFIG); ++ if (!config_file) ++ oom_failure(); ++ + list_only =3D 0; +=20 + for(i =3D 0; i < argc; i++) { + if (!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config")) { + config_file =3D strdup(argv[i + 1]); ++ if (!config_file) ++ oom_failure(); + } + if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { + printf("restard %s - Copyright 2000-2002 Tibor Koleszar \n" +- " Copyright 2006 Aur=C3=A9lien G=C3=89R= =C3=94ME \n", ++ " Copyright 2006 Aur=C3=A9lien G=C3=89R= =C3=94ME \n" ++ " Copyright 2022 Maxime Devos \n", + VERSION); + exit(0); + } +@@ -118,10 +143,13 @@ int main(int argc, char *argv[]) + " -i : the check interval in second\n" + " -l : list configuration options\n" + " -h : help\n\n", VERSION); ++ exit(0); + } + } +=20 + config_process =3D malloc(sizeof(struct config_process_type) * 128); ++ if (!config_process) ++ oom_failure(); +=20=20=20 + read_config(); + if (list_only) { +@@ -133,9 +161,17 @@ int main(int argc, char *argv[]) + config_process_number); +=20=20=20 + procdir_dirent =3D malloc(sizeof(struct dirent)); ++ if (!procdir_dirent) ++ oom_failure(); + proc_cmdline_str =3D (char *) malloc(1024); ++ if (!proc_cmdline_str) ++ oom_failure(); + proc_cmdline_name =3D (char *) malloc(1024); ++ if (!proc_cmdline_name) ++ oom_failure(); + regc =3D malloc(1024); ++ if (!regc) ++ oom_failure(); +=20=20=20 + /* Catch signals */ + signal(SIGTERM, got_signal); +@@ -187,8 +223,19 @@ int main(int argc, char *argv[]) + } +=20 + out_proc =3D fopen("/var/run/restartd.pid", "wt"); +- fprintf(out_proc, "%d", getpid()); +- fclose(out_proc); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd.pid"); ++ return -1; ++ } ++ if (fprintf(out_proc, "%d", getpid()) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exit= ing."); ++ return -1; ++ } ++ if (fclose(out_proc) < 0) { /* errors can happen when flushing th= e buffer */ ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exit= ing."); ++ return -1; ++ } ++ +=20 + while(1) { + if ((procdir_id =3D opendir("/proc")) =3D=3D NULL) { +@@ -237,16 +284,23 @@ int main(int argc, char *argv[]) + now =3D time(NULL); +=20 + out_proc =3D fopen("/var/run/restartd", "wt"); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd.pid"); ++ return -1; ++ } +=20 +- fprintf(out_proc, "%s\n", ctime(&now)); ++ if (fprintf(out_proc, "%s\n", ctime(&now)) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd. Exiti= ng."); ++ return -1; ++ } +=20 + for(i=3D0; i 0) { + if (strlen(config_process[i].running) > 0) { + strcpy(config_process[i].status, "running"); +- syslog(LOG_INFO, "%s is running, executing '%s'", ++ /* syslog(LOG_INFO, "%s is running, executing '%s'= ", + config_process[i].name, +- config_process[i].running); ++ config_process[i].running); */ + system(config_process[i].running); + } else { + strcpy(config_process[i].status, "running"); +@@ -267,12 +321,18 @@ int main(int argc, char *argv[]) + strcpy(config_process[i].status, "not running"); + } +=20 +- fprintf(out_proc, "%-12s %-12s %s\n", +- config_process[i].name, config_process[i].status, +- config_process[i].processes); ++ if (fprintf(out_proc, "%-12s %-12s %s\n", ++ config_process[i].name, config_process[i].sta= tus, ++ config_process[i].processes) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd. = Exiting."); ++ return -1; ++ } + } +=20 +- fclose(out_proc); ++ if (fclose(out_proc) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. = Exiting."); ++ return -1; ++ } +=20 + sleep(check_interval); + } +--=20 +2.37.3 + --=20 Best regards, Nicolas Graves From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH v2] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> In-Reply-To: <87czcp8wet.fsf@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 03 Feb 2024 13:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57387@debbugs.gnu.org Cc: maximedevos@telenet.be, ngraves@ngraves.fr, othacehe@gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.170696743621672 (code B ref 57387); Sat, 03 Feb 2024 13:38:02 +0000 Received: (at 57387) by debbugs.gnu.org; 3 Feb 2024 13:37:16 +0000 Received: from localhost ([127.0.0.1]:45985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWGCp-0005dT-0n for submit@debbugs.gnu.org; Sat, 03 Feb 2024 08:37:15 -0500 Received: from 6.mo576.mail-out.ovh.net ([46.105.50.107]:37587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWGCj-0005dH-A4 for 57387@debbugs.gnu.org; Sat, 03 Feb 2024 08:37:13 -0500 Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.2.10]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 5E70D32C74 for <57387@debbugs.gnu.org>; Sat, 3 Feb 2024 13:36:56 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-xwx9m (unknown [10.108.54.213]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id B05771FD4D; Sat, 3 Feb 2024 13:36:55 +0000 (UTC) Received: from ngraves.fr ([37.59.142.107]) by ghost-submission-6684bf9d7b-xwx9m with ESMTPSA id rqS2JndBvmWDoQAA993phA (envelope-from ); Sat, 03 Feb 2024 13:36:55 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-107S001924d65a7-77fa-4302-b471-54a6aec8aa1d, F5ADB67915646DBFD32EB3060FF73679FEA22C13) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves Date: Sat, 3 Feb 2024 14:36:01 +0100 Message-ID: <20240203133608.17867-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 4717520613865218574 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrfeduiedghedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeeigeevkeejhefhieefffdvfeektdeitdfgkefhtddvgfetvdekleeuveffgeeuueenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhlrghunhgthhhprggurdhnvghtpdguvggsihgrnhdrohhrghenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepheejfeekjeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejiedpmhhouggvpehsmhhtphhouhht X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/admin.scm (restartd): New variable. --- gnu/packages/admin.scm | 51 +++ .../patches/restartd-update-robust.patch | 295 ++++++++++++++++++ 2 files changed, 346 insertions(+) create mode 100644 gnu/packages/patches/restartd-update-robust.patch diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index fcf05992d8..6940638c75 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -62,6 +62,7 @@ ;;; Copyright © 2023 Bruno Victal ;;; Copyright © 2023 Tobias Kortkamp ;;; Copyright © 2023 Jaeme Sifat +;;; Copyright © 2023 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -5814,6 +5815,56 @@ (define-public fail2ban mechanisms if you really want to protect services.") (license license:gpl2+))) +(define-public restartd + (let* ((commit "7044125ac55056f2663536f7137170edf92ebd75") + ;; Version is 0.2.4 in the version file in the repo + ;; but not in github tags. + ;; It is released as 0.2.3-1.1 for other distributions. + ;; Probably because of the lack of activity upstream. + (revision "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 (search-patches "restartd-update-robust.patch")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ; no tests + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (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. The daemon runs an user-provided script +when it detects a program in the running processes, or an alternate script if +it doesn't detect the program. 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") diff --git a/gnu/packages/patches/restartd-update-robust.patch b/gnu/packages/patches/restartd-update-robust.patch new file mode 100644 index 0000000000..d279ebd8ff --- /dev/null +++ b/gnu/packages/patches/restartd-update-robust.patch @@ -0,0 +1,295 @@ +From 01cd2d15a9bf1109e0e71b3e31b835d63dcf9cd8 Mon Sep 17 00:00:00 2001 +From: Maxime Devos , Yin Kangkai , Sudip Mukherjee +Subject: [PATCH] + +Fix segfault when run as normal user + +Also exit immediately when "restartd -h" +Signed-off-by: Yin Kangkai + +Fix build with gcc-10 + +Bug: https://bugs.debian.org/957761 +Signed-off-by: Sudip Mukherjee + +Handle memory allocation failures. + +This makes the code a little more robust. +Signed-off-by: Maxime Devos + +Handle fopen failures. + +This makes the code a little more robust. What if /var/run does not +exist, or we do not have permission to open +/var/run/restartd.pid (EPERM?) due to SELinux misconfiguration? +Signed-off-by: Maxime Devos + +Handle printf and fprintf failures. + +This makes the code a little more robust. What if the write was +refused to the underlying device being removed? + +The --help, debug and stderr printfs were ignored because there error +handling does not appear important to me. +Signed-off-by: Maxime Devos + +Handle fclose failures when writing. + +This makes the code a little more robust. What if a quotum is exceeded? +Signed-off-by: Maxime Devos +--- + config.c | 19 +++++++++---- + config.h | 14 ++++++---- + restartd.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++------- + 3 files changed, 92 insertions(+), 21 deletions(-) + +diff --git a/config.c b/config.c +index f307b8a..5cc0271 100644 +--- a/config.c ++++ b/config.c +@@ -57,7 +57,11 @@ int read_config(void) + config_process_number = 0; + + line1 = (char *) malloc(MAX_LINE_LENGTH); ++ if (!line1) ++ oom_failure(); + line2 = (char *) malloc(MAX_LINE_LENGTH); ++ if (!line2) ++ oom_failure(); + + if ((config_fd = fopen(config_file, "rt")) == NULL) { + fprintf(stderr, "Error at opening config file: %s\n", config_file); +@@ -155,11 +159,16 @@ void dump_config(void) { + int i; + + for(i=0; i + * Copyright (C) 2006 Aurélien GÉRÔME ++ * Copyright (C) 2022 Maxime Devos + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -25,12 +26,12 @@ + + #define DEFAULT_CONFIG "/etc/restartd.conf" + +-int debug; +-int config_process_number; +-int check_interval; +-int foreground; +-struct config_process_type *config_process; +-char *config_file; ++extern int debug; ++extern int config_process_number; ++extern int check_interval; ++extern int foreground; ++extern struct config_process_type *config_process; ++extern char *config_file; + + typedef struct config_process_type { + char name[64]; +@@ -43,5 +44,6 @@ typedef struct config_process_type { + + int read_config(/* char *config_file */); + void dump_config(void); ++void oom_failure(void); + + #endif /* RESTARTD_CONFIG_H */ +diff --git a/restartd.c b/restartd.c +index 2aa720c..aa74334 100644 +--- a/restartd.c ++++ b/restartd.c +@@ -1,6 +1,7 @@ + /* restartd - Process checker and/or restarter daemon + * Copyright (C) 2000-2002 Tibor Koleszar + * Copyright (C) 2006 Aurélien GÉRÔME ++ * Copyright (C) 2022 Maxime Devos + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -35,6 +36,13 @@ + + #include "config.h" + ++int debug; ++int config_process_number; ++int check_interval; ++int foreground; ++struct config_process_type *config_process; ++char *config_file; ++ + /* SIGTERM & SIGHUP handler */ + void got_signal(int sig) + { +@@ -52,6 +60,17 @@ void got_signal(int sig) + } + } + ++/* Ignoring out-of-memory failures is risky on systems without virtual memory ++ where additionally at address 0 there is actually something important ++ mapped. Additionally, while often on Linux the OOM killer will kill processes ++ where an OOM happens, this is not always the case and there exist other systems ++ without an OOM killer (e.g. the Hurd). */ ++void oom_failure() ++{ ++ syslog(LOG_ERR, "Failed to allocate memory. Exiting."); ++ exit(1); ++} ++ + int main(int argc, char *argv[]) + { + DIR *procdir_id; +@@ -75,15 +94,21 @@ int main(int argc, char *argv[]) + + /* Options */ + config_file = strdup(DEFAULT_CONFIG); ++ if (!config_file) ++ oom_failure(); ++ + list_only = 0; + + for(i = 0; i < argc; i++) { + if (!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config")) { + config_file = strdup(argv[i + 1]); ++ if (!config_file) ++ oom_failure(); + } + if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { + printf("restard %s - Copyright 2000-2002 Tibor Koleszar \n" +- " Copyright 2006 Aurélien GÉRÔME \n", ++ " Copyright 2006 Aurélien GÉRÔME \n" ++ " Copyright 2022 Maxime Devos \n", + VERSION); + exit(0); + } +@@ -118,10 +143,13 @@ int main(int argc, char *argv[]) + " -i : the check interval in second\n" + " -l : list configuration options\n" + " -h : help\n\n", VERSION); ++ exit(0); + } + } + + config_process = malloc(sizeof(struct config_process_type) * 128); ++ if (!config_process) ++ oom_failure(); + + read_config(); + if (list_only) { +@@ -133,9 +161,17 @@ int main(int argc, char *argv[]) + config_process_number); + + procdir_dirent = malloc(sizeof(struct dirent)); ++ if (!procdir_dirent) ++ oom_failure(); + proc_cmdline_str = (char *) malloc(1024); ++ if (!proc_cmdline_str) ++ oom_failure(); + proc_cmdline_name = (char *) malloc(1024); ++ if (!proc_cmdline_name) ++ oom_failure(); + regc = malloc(1024); ++ if (!regc) ++ oom_failure(); + + /* Catch signals */ + signal(SIGTERM, got_signal); +@@ -187,8 +223,19 @@ int main(int argc, char *argv[]) + } + + out_proc = fopen("/var/run/restartd.pid", "wt"); +- fprintf(out_proc, "%d", getpid()); +- fclose(out_proc); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd.pid"); ++ return -1; ++ } ++ if (fprintf(out_proc, "%d", getpid()) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting."); ++ return -1; ++ } ++ if (fclose(out_proc) < 0) { /* errors can happen when flushing the buffer */ ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting."); ++ return -1; ++ } ++ + + while(1) { + if ((procdir_id = opendir("/proc")) == NULL) { +@@ -237,16 +284,23 @@ int main(int argc, char *argv[]) + now = time(NULL); + + out_proc = fopen("/var/run/restartd", "wt"); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd.pid"); ++ return -1; ++ } + +- fprintf(out_proc, "%s\n", ctime(&now)); ++ if (fprintf(out_proc, "%s\n", ctime(&now)) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd. Exiting."); ++ return -1; ++ } + + for(i=0; i 0) { + if (strlen(config_process[i].running) > 0) { + strcpy(config_process[i].status, "running"); +- syslog(LOG_INFO, "%s is running, executing '%s'", ++ /* syslog(LOG_INFO, "%s is running, executing '%s'", + config_process[i].name, +- config_process[i].running); ++ config_process[i].running); */ + system(config_process[i].running); + } else { + strcpy(config_process[i].status, "running"); +@@ -267,12 +321,18 @@ int main(int argc, char *argv[]) + strcpy(config_process[i].status, "not running"); + } + +- fprintf(out_proc, "%-12s %-12s %s\n", +- config_process[i].name, config_process[i].status, +- config_process[i].processes); ++ if (fprintf(out_proc, "%-12s %-12s %s\n", ++ config_process[i].name, config_process[i].status, ++ config_process[i].processes) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd. Exiting."); ++ return -1; ++ } + } + +- fclose(out_proc); ++ if (fclose(out_proc) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting."); ++ return -1; ++ } + + sleep(check_interval); + } +-- +2.37.3 + -- 2.41.0 From unknown Fri Aug 15 20:51:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57387] [PATCH v3] gnu: Add restartd. References: <87czcp8wet.fsf@ngraves.fr> In-Reply-To: <87czcp8wet.fsf@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 03 Feb 2024 14:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57387@debbugs.gnu.org Cc: maximedevos@telenet.be, ngraves@ngraves.fr, othacehe@gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.170696920924738 (code B ref 57387); Sat, 03 Feb 2024 14:07:01 +0000 Received: (at 57387) by debbugs.gnu.org; 3 Feb 2024 14:06:49 +0000 Received: from localhost ([127.0.0.1]:46001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWGfP-0006Qv-Ot for submit@debbugs.gnu.org; Sat, 03 Feb 2024 09:06:48 -0500 Received: from 8.mo575.mail-out.ovh.net ([46.105.74.219]:33077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWGfK-0006Qg-43 for 57387@debbugs.gnu.org; Sat, 03 Feb 2024 09:06:45 -0500 Received: from director8.ghost.mail-out.ovh.net (unknown [10.108.2.23]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id ADECF29410 for <57387@debbugs.gnu.org>; Sat, 3 Feb 2024 14:06:28 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-9bx58 (unknown [10.108.54.212]) by director8.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 17F131FD15; Sat, 3 Feb 2024 14:06:27 +0000 (UTC) Received: from ngraves.fr ([37.59.142.107]) by ghost-submission-6684bf9d7b-9bx58 with ESMTPSA id V05BO2NIvmXmAgAAPnR5nw (envelope-from ); Sat, 03 Feb 2024 14:06:27 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-107S001a95e5700-ce43-4de3-b5b4-aa0903573b7d, F5ADB67915646DBFD32EB3060FF73679FEA22C13) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves Date: Sat, 3 Feb 2024 15:06:17 +0100 Message-ID: <20240203140625.25139-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 5216294269097075214 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrfeduiedgheekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeeigeevkeejhefhieefffdvfeektdeitdfgkefhtddvgfetvdekleeuveffgeeuueenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhlrghunhgthhhprggurdhnvghtpdguvggsihgrnhdrohhrghenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepheejfeekjeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejhedpmhhouggvpehsmhhtphhouhht X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/admin.scm (restartd): New variable. * gnu/packages/patches/restartd-update-robust.patch: Add file. * gnu/local.mk: Register gnu/packages/patches/restartd-update-robust.patch. Change-Id: I38b9b70e97b64f006a86d7618a75f1ec3ed8b034 --- gnu/local.mk | 1 + gnu/packages/admin.scm | 51 +++ .../patches/restartd-update-robust.patch | 295 ++++++++++++++++++ 3 files changed, 347 insertions(+) create mode 100644 gnu/packages/patches/restartd-update-robust.patch diff --git a/gnu/local.mk b/gnu/local.mk index fbdb285695..6e4c3b277b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1981,6 +1981,7 @@ dist_patch_DATA = \ %D%/packages/patches/racket-rktio-bin-sh.patch \ %D%/packages/patches/racket-zuo-bin-sh.patch \ %D%/packages/patches/remake-impure-dirs.patch \ + %D%/packages/patches/restartd-update-robust.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ %D%/packages/patches/rng-tools-revert-build-randstat.patch \ %D%/packages/patches/rocclr-5.6.0-enable-gfx800.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index fcf05992d8..6940638c75 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -62,6 +62,7 @@ ;;; Copyright © 2023 Bruno Victal ;;; Copyright © 2023 Tobias Kortkamp ;;; Copyright © 2023 Jaeme Sifat +;;; Copyright © 2023 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -5814,6 +5815,56 @@ (define-public fail2ban mechanisms if you really want to protect services.") (license license:gpl2+))) +(define-public restartd + (let* ((commit "7044125ac55056f2663536f7137170edf92ebd75") + ;; Version is 0.2.4 in the version file in the repo + ;; but not in github tags. + ;; It is released as 0.2.3-1.1 for other distributions. + ;; Probably because of the lack of activity upstream. + (revision "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 (search-patches "restartd-update-robust.patch")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ; no tests + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (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. The daemon runs an user-provided script +when it detects a program in the running processes, or an alternate script if +it doesn't detect the program. 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") diff --git a/gnu/packages/patches/restartd-update-robust.patch b/gnu/packages/patches/restartd-update-robust.patch new file mode 100644 index 0000000000..d279ebd8ff --- /dev/null +++ b/gnu/packages/patches/restartd-update-robust.patch @@ -0,0 +1,295 @@ +From 01cd2d15a9bf1109e0e71b3e31b835d63dcf9cd8 Mon Sep 17 00:00:00 2001 +From: Maxime Devos , Yin Kangkai , Sudip Mukherjee +Subject: [PATCH] + +Fix segfault when run as normal user + +Also exit immediately when "restartd -h" +Signed-off-by: Yin Kangkai + +Fix build with gcc-10 + +Bug: https://bugs.debian.org/957761 +Signed-off-by: Sudip Mukherjee + +Handle memory allocation failures. + +This makes the code a little more robust. +Signed-off-by: Maxime Devos + +Handle fopen failures. + +This makes the code a little more robust. What if /var/run does not +exist, or we do not have permission to open +/var/run/restartd.pid (EPERM?) due to SELinux misconfiguration? +Signed-off-by: Maxime Devos + +Handle printf and fprintf failures. + +This makes the code a little more robust. What if the write was +refused to the underlying device being removed? + +The --help, debug and stderr printfs were ignored because there error +handling does not appear important to me. +Signed-off-by: Maxime Devos + +Handle fclose failures when writing. + +This makes the code a little more robust. What if a quotum is exceeded? +Signed-off-by: Maxime Devos +--- + config.c | 19 +++++++++---- + config.h | 14 ++++++---- + restartd.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++------- + 3 files changed, 92 insertions(+), 21 deletions(-) + +diff --git a/config.c b/config.c +index f307b8a..5cc0271 100644 +--- a/config.c ++++ b/config.c +@@ -57,7 +57,11 @@ int read_config(void) + config_process_number = 0; + + line1 = (char *) malloc(MAX_LINE_LENGTH); ++ if (!line1) ++ oom_failure(); + line2 = (char *) malloc(MAX_LINE_LENGTH); ++ if (!line2) ++ oom_failure(); + + if ((config_fd = fopen(config_file, "rt")) == NULL) { + fprintf(stderr, "Error at opening config file: %s\n", config_file); +@@ -155,11 +159,16 @@ void dump_config(void) { + int i; + + for(i=0; i + * Copyright (C) 2006 Aurélien GÉRÔME ++ * Copyright (C) 2022 Maxime Devos + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -25,12 +26,12 @@ + + #define DEFAULT_CONFIG "/etc/restartd.conf" + +-int debug; +-int config_process_number; +-int check_interval; +-int foreground; +-struct config_process_type *config_process; +-char *config_file; ++extern int debug; ++extern int config_process_number; ++extern int check_interval; ++extern int foreground; ++extern struct config_process_type *config_process; ++extern char *config_file; + + typedef struct config_process_type { + char name[64]; +@@ -43,5 +44,6 @@ typedef struct config_process_type { + + int read_config(/* char *config_file */); + void dump_config(void); ++void oom_failure(void); + + #endif /* RESTARTD_CONFIG_H */ +diff --git a/restartd.c b/restartd.c +index 2aa720c..aa74334 100644 +--- a/restartd.c ++++ b/restartd.c +@@ -1,6 +1,7 @@ + /* restartd - Process checker and/or restarter daemon + * Copyright (C) 2000-2002 Tibor Koleszar + * Copyright (C) 2006 Aurélien GÉRÔME ++ * Copyright (C) 2022 Maxime Devos + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -35,6 +36,13 @@ + + #include "config.h" + ++int debug; ++int config_process_number; ++int check_interval; ++int foreground; ++struct config_process_type *config_process; ++char *config_file; ++ + /* SIGTERM & SIGHUP handler */ + void got_signal(int sig) + { +@@ -52,6 +60,17 @@ void got_signal(int sig) + } + } + ++/* Ignoring out-of-memory failures is risky on systems without virtual memory ++ where additionally at address 0 there is actually something important ++ mapped. Additionally, while often on Linux the OOM killer will kill processes ++ where an OOM happens, this is not always the case and there exist other systems ++ without an OOM killer (e.g. the Hurd). */ ++void oom_failure() ++{ ++ syslog(LOG_ERR, "Failed to allocate memory. Exiting."); ++ exit(1); ++} ++ + int main(int argc, char *argv[]) + { + DIR *procdir_id; +@@ -75,15 +94,21 @@ int main(int argc, char *argv[]) + + /* Options */ + config_file = strdup(DEFAULT_CONFIG); ++ if (!config_file) ++ oom_failure(); ++ + list_only = 0; + + for(i = 0; i < argc; i++) { + if (!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config")) { + config_file = strdup(argv[i + 1]); ++ if (!config_file) ++ oom_failure(); + } + if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { + printf("restard %s - Copyright 2000-2002 Tibor Koleszar \n" +- " Copyright 2006 Aurélien GÉRÔME \n", ++ " Copyright 2006 Aurélien GÉRÔME \n" ++ " Copyright 2022 Maxime Devos \n", + VERSION); + exit(0); + } +@@ -118,10 +143,13 @@ int main(int argc, char *argv[]) + " -i : the check interval in second\n" + " -l : list configuration options\n" + " -h : help\n\n", VERSION); ++ exit(0); + } + } + + config_process = malloc(sizeof(struct config_process_type) * 128); ++ if (!config_process) ++ oom_failure(); + + read_config(); + if (list_only) { +@@ -133,9 +161,17 @@ int main(int argc, char *argv[]) + config_process_number); + + procdir_dirent = malloc(sizeof(struct dirent)); ++ if (!procdir_dirent) ++ oom_failure(); + proc_cmdline_str = (char *) malloc(1024); ++ if (!proc_cmdline_str) ++ oom_failure(); + proc_cmdline_name = (char *) malloc(1024); ++ if (!proc_cmdline_name) ++ oom_failure(); + regc = malloc(1024); ++ if (!regc) ++ oom_failure(); + + /* Catch signals */ + signal(SIGTERM, got_signal); +@@ -187,8 +223,19 @@ int main(int argc, char *argv[]) + } + + out_proc = fopen("/var/run/restartd.pid", "wt"); +- fprintf(out_proc, "%d", getpid()); +- fclose(out_proc); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd.pid"); ++ return -1; ++ } ++ if (fprintf(out_proc, "%d", getpid()) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting."); ++ return -1; ++ } ++ if (fclose(out_proc) < 0) { /* errors can happen when flushing the buffer */ ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting."); ++ return -1; ++ } ++ + + while(1) { + if ((procdir_id = opendir("/proc")) == NULL) { +@@ -237,16 +284,23 @@ int main(int argc, char *argv[]) + now = time(NULL); + + out_proc = fopen("/var/run/restartd", "wt"); ++ if (!out_proc) { ++ syslog(LOG_ERR, "Failed to open /var/run/restartd.pid"); ++ return -1; ++ } + +- fprintf(out_proc, "%s\n", ctime(&now)); ++ if (fprintf(out_proc, "%s\n", ctime(&now)) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd. Exiting."); ++ return -1; ++ } + + for(i=0; i 0) { + if (strlen(config_process[i].running) > 0) { + strcpy(config_process[i].status, "running"); +- syslog(LOG_INFO, "%s is running, executing '%s'", ++ /* syslog(LOG_INFO, "%s is running, executing '%s'", + config_process[i].name, +- config_process[i].running); ++ config_process[i].running); */ + system(config_process[i].running); + } else { + strcpy(config_process[i].status, "running"); +@@ -267,12 +321,18 @@ int main(int argc, char *argv[]) + strcpy(config_process[i].status, "not running"); + } + +- fprintf(out_proc, "%-12s %-12s %s\n", +- config_process[i].name, config_process[i].status, +- config_process[i].processes); ++ if (fprintf(out_proc, "%-12s %-12s %s\n", ++ config_process[i].name, config_process[i].status, ++ config_process[i].processes) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd. Exiting."); ++ return -1; ++ } + } + +- fclose(out_proc); ++ if (fclose(out_proc) < 0) { ++ syslog(LOG_ERR, "Failed to write to /var/run/restartd.pid. Exiting."); ++ return -1; ++ } + + sleep(check_interval); + } +-- +2.37.3 + -- 2.41.0 From unknown Fri Aug 15 20:51:42 2025 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: Sat, 03 Feb 2024 14:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 57387@debbugs.gnu.org Received: via spool by 57387-submit@debbugs.gnu.org id=B57387.170696927224846 (code B ref 57387); Sat, 03 Feb 2024 14:08:02 +0000 Received: (at 57387) by debbugs.gnu.org; 3 Feb 2024 14:07:52 +0000 Received: from localhost ([127.0.0.1]:46005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWGgS-0006Sf-1l for submit@debbugs.gnu.org; Sat, 03 Feb 2024 09:07:52 -0500 Received: from 1.mo560.mail-out.ovh.net ([46.105.63.121]:38385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWGgP-0006SV-NK for 57387@debbugs.gnu.org; Sat, 03 Feb 2024 09:07:50 -0500 Received: from director11.ghost.mail-out.ovh.net (unknown [10.108.9.56]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id D711D29223 for <57387@debbugs.gnu.org>; Sat, 3 Feb 2024 14:07:36 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-ctqx5 (unknown [10.110.178.147]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 809151FDF1; Sat, 3 Feb 2024 14:07:36 +0000 (UTC) Received: from ngraves.fr ([37.59.142.106]) by ghost-submission-6684bf9d7b-ctqx5 with ESMTPSA id fsPhG6hIvmXxigQA2FAFRA (envelope-from ); Sat, 03 Feb 2024 14:07:36 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-106R006fda83ac2-3108-435d-946c-ceaa2cdcb299, F5ADB67915646DBFD32EB3060FF73679FEA22C13) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves In-Reply-To: <875yhqcs7f.fsf_-_@gnu.org> References: <87czcp8wet.fsf@ngraves.fr> <87a67qsl9y.fsf@ngraves.fr> <875yhqcs7f.fsf_-_@gnu.org> Date: Sat, 03 Feb 2024 15:07:35 +0100 Message-ID: <87il35d4k8.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 5235434570195067589 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrfeduiedgheekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepveekleeujedthefgffekleekhffhffetgfdvheekleeuhfehueeljedtjefhvdfgnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugeeirddvtdekpdefjedrheelrddugedvrddutdeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeehjeefkeejseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Mathieu, Done in a rebased v3, you can ignore the v2. Sorry for the time it took. Nicolas On 2022-09-14 09:48, Mathieu Othacehe wrote: > Hello Nicolas, > >> ...td-add-error-handling-for-robustness.patch | 242 ++++++++++++++++++ >> .../patches/restartd-fix-compilation.patch | 53 ++++ > > Both patches also need to be added to the dist_patch_DATA variable of > gnu/local.mk. > > Thanks, > > Mathieu > > > -- Best regards, Nicolas Graves From unknown Fri Aug 15 20:51:42 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Nicolas Graves Subject: bug#57387: closed (Re: [bug#57387] [PATCH v3] gnu: Add restartd.) Message-ID: References: <87h6i5n7pg.fsf@gnu.org> <87czcp8wet.fsf@ngraves.fr> X-Gnu-PR-Message: they-closed 57387 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 57387@debbugs.gnu.org Date: Sun, 18 Feb 2024 14:56:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1708268162-5791-1" This is a multi-part message in MIME format... ------------=_1708268162-5791-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #57387: [PATCH] gnu: Add restartd. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 57387@debbugs.gnu.org. --=20 57387: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D57387 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1708268162-5791-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 57387-done) by debbugs.gnu.org; 18 Feb 2024 14:55:24 +0000 Received: from localhost ([127.0.0.1]:34811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbiZg-00015M-6G for submit@debbugs.gnu.org; Sun, 18 Feb 2024 09:55:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbiZd-0000zn-JI for 57387-done@debbugs.gnu.org; Sun, 18 Feb 2024 09:55:22 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbiZC-0001bU-MF; Sun, 18 Feb 2024 09:54:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=tLmhtjD7OGVCRwCivvj2ZHIY7QFlXiYyAQSwMcOiiik=; b=lft2L19yVDnsmOiVF0AQ J2l+vL5oK4g9dV5yDaNHOGP4rY/kDvYmVwgKxhcODlIfhU1olwEI5pzx4B9dDPdA+TM/+0xHVOi+K PO8DkYP1u7zeE4jEwbA6nCCTyRAlGo2DbfmlWUdOTmNbnSoYmvXz75ZQiInnZFJMEcp6lYUb0CuLF ZXLQPwB91/hmpDsJYjzAKJJ0ht0fbekqNdRHoyQnM+Spup6RsV3vwNOw5v/xF2pv6hnRhJJdEm4Y6 0GVk4Rioiw9c9k6zbzqbIGu/zpQWZI//El3tFjHq0ciM5SL3vxG955CB9AazhfwsZeV2kVlMIjQop KOWmF0GrkRVovQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Nicolas Graves Subject: Re: [bug#57387] [PATCH v3] gnu: Add restartd. In-Reply-To: <20240203140625.25139-1-ngraves@ngraves.fr> (Nicolas Graves's message of "Sat, 3 Feb 2024 15:06:17 +0100") References: <87czcp8wet.fsf@ngraves.fr> <20240203140625.25139-1-ngraves@ngraves.fr> Date: Sun, 18 Feb 2024 15:54:51 +0100 Message-ID: <87h6i5n7pg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 57387-done Cc: othacehe@gnu.org, 57387-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Nicolas Graves skribis: > * gnu/packages/admin.scm (restartd): New variable. > * gnu/packages/patches/restartd-update-robust.patch: Add file. > * gnu/local.mk: Register gnu/packages/patches/restartd-update-robust.patc= h. > > Change-Id: I38b9b70e97b64f006a86d7618a75f1ec3ed8b034 Applied with the changes below, thanks! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 9f51427297..47c82e9678 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -5886,12 +5886,13 @@ (define-public restartd (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. The daemon runs an user-provided script -when it detects a program in the running processes, or an alternate script if -it doesn't detect the program. The daemon can only be called by the root -user, but can use @code{sudo -u user} in the process called if needed.") + (description "This package provides a daemon for checking running and +not running processes. It reads the @file{/proc} directory every @var{n} +seconds and does a POSIX regexp on the process names. The daemon runs a +user-provided script when it detects a program in the running processes, or an +alternate script if it doesn't detect the program. The daemon can only be +called by the root user, but can use @command{sudo -u user} in the process +called if needed.") (license license:gpl2+)))) (define-public rex --=-=-=-- ------------=_1708268162-5791-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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 From: Nicolas Graves To: guix-patches@gnu.org Subject: [PATCH] gnu: Add restartd. Date: Wed, 24 Aug 2022 17:59:38 +0200 Message-ID: <87czcp8wet.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: ngraves@ngraves.fr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * 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 =C2=A9 2021 Artyom V. Poptsov ;;; Copyright =C2=A9 2022 Wamm K. D. ;;; Copyright =C2=A9 2022 Roman Riabenko +;;; Copyright =C2=A9 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+))) =20 +(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 \\?=3D gcc") "CC =3D gcc")))) + (delete 'configure) + (replace 'install + (lambda _ + (install-file "restartd.conf" (string-append #$output "/et= c")) + (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 an= d 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 ro= ot +user, but can use @code{sudo -u user} in the process called if needed.") + (license license:gpl2)))) + (define-public rex (package (name "rex") --=20 2.37.2 <#secure method=3Dpgpmime mode=3Dsign> --=20 Best regards, Nicolas Graves ------------=_1708268162-5791-1--