From unknown Thu Sep 11 15:11:11 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#45589 <45589@debbugs.gnu.org> To: bug#45589 <45589@debbugs.gnu.org> Subject: Status: [PATCH] services: Add keepalived service. Reply-To: bug#45589 <45589@debbugs.gnu.org> Date: Thu, 11 Sep 2025 22:11:11 +0000 retitle 45589 [PATCH] services: Add keepalived service. reassign 45589 guix-patches submitter 45589 Oleg Pykhalov severity 45589 normal tag 45589 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 01 05:14:41 2021 Received: (at submit) by debbugs.gnu.org; 1 Jan 2021 10:14:41 +0000 Received: from localhost ([127.0.0.1]:55361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvHSA-000590-Dw for submit@debbugs.gnu.org; Fri, 01 Jan 2021 05:14:41 -0500 Received: from lists.gnu.org ([209.51.188.17]:55544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvHS8-00058s-Dc for submit@debbugs.gnu.org; Fri, 01 Jan 2021 05:14:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvHS8-0000ND-8h for guix-patches@gnu.org; Fri, 01 Jan 2021 05:14:36 -0500 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:36041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvHS6-0006Lq-Ax for guix-patches@gnu.org; Fri, 01 Jan 2021 05:14:35 -0500 Received: by mail-lf1-x135.google.com with SMTP id o13so48435930lfr.3 for ; Fri, 01 Jan 2021 02:14:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tWeT4MQhBDlTUeblpf3lU36d3kAVbL9MuqiJCGEp4gg=; b=T6fY/9cb01klmCQuGkAqMJwL1hnW+/19OQhDdKlqz5p656mcgxB+a4FS4UGUzej2uE NNkVTS8ozJ7Pv5GkTWER+YDsDR4mBTUI+bZ4/TQ8M/eE6l6I9PVIxGhx8YgMgjDjkaSi 6Wt5bl8Vr7/yrfqXSdIKK3zJREAHvYpQmLqjStipPWin3ut87UyXdXTsDcoJNXTNyCjU PinY02tJfC6ZV/dz8lbb8FWMyNJDJm07gb9moCXIioEb9QXlXRjRao2DKB3O1Z4O5ejt 26bK747iyuNxGO+4XzbQKBw7DV8aaGwiwdFF1UfhNIt3LnS8+xSb/bMeS8XVJs2z8tei B+HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tWeT4MQhBDlTUeblpf3lU36d3kAVbL9MuqiJCGEp4gg=; b=ZdW6F6rald8mAFyAHkPLdGl0INKc5YuWxhpA8k9spGcU1XNQj1264U8O2rO9rxjJBh 3dQZh9Pn+IPoM52/DH/EZPSbWmQRsvOQswo7ydA9qA2I/18JcS7Kh1lq6+09qhL/aOON HgY8gHaQFgo4soXughSr8rMDLL1vE66AgGJsHlYuEUeRSHqRLrPHNgbvkNZqrhJz22FD pZUGY0N0XJOczIzDvACjMNu37XxOa7KBLYqatXNCd/YDbTyg7aVLxUgA17hyo1V5guF4 tmdNT05nGrDcoEaMJzd2HesrxH/ifXY/lKMxOO3pVOrtX9Xd/D09RtFreG344musMcEj Zgrg== X-Gm-Message-State: AOAM530xSFT4lMVMy7p4d1jz6TblRvTkWqFC+/jK685FsvdfIhAXJ6ws +43F9zz07q2GOUB2tEywh7GIqTgOvh0= X-Google-Smtp-Source: ABdhPJzKiiUYvxaSRMi0BoNTdJdaRidoAwhbRPjeVIb+VvzFHPClCSkJxq0uKJhSfMkq3l7AX6kAxA== X-Received: by 2002:a2e:9f01:: with SMTP id u1mr28709954ljk.386.1609496071064; Fri, 01 Jan 2021 02:14:31 -0800 (PST) Received: from localhost.localdomain ([178.71.74.207]) by smtp.gmail.com with ESMTPSA id v10sm7834648lji.130.2021.01.01.02.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jan 2021 02:14:30 -0800 (PST) From: Oleg Pykhalov To: guix-patches@gnu.org Subject: [PATCH] services: Add keepalived service. Date: Fri, 1 Jan 2021 13:14:21 +0300 Message-Id: <20210101101421.9847-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=go.wigust@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Oleg Pykhalov 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/services/networking.scm (): New record. (keepalived-shepherd-service): New procedure. (keepalived-service-type): New variable. * doc/guix.texi (Networking Services): Document this. --- doc/guix.texi | 54 ++++++++++++++++++++++++++++++++++++- gnu/services/networking.scm | 47 +++++++++++++++++++++++++++++++- 2 files changed, 99 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1081ed26a3..b11554fb4d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -55,7 +55,7 @@ Copyright @copyright{} 2017 Andy Wingo@* Copyright @copyright{} 2017, 2018, 2019, 2020 Arun Isaac@* Copyright @copyright{} 2017 nee@* Copyright @copyright{} 2018 Rutger Helling@* -Copyright @copyright{} 2018 Oleg Pykhalov@* +Copyright @copyright{} 2018, 2021 Oleg Pykhalov@* Copyright @copyright{} 2018 Mike Gerwitz@* Copyright @copyright{} 2018 Pierre-Antoine Rouby@* Copyright @copyright{} 2018, 2019 Gábor Boskovits@* @@ -17156,6 +17156,58 @@ address, delete everything except these options: @end table @end deftp +@cindex keepalived +@deffn {Scheme Variable} keepalived-service-type +This is the type for the @uref{https://www.keepalived.org/, Keepalived} +routing software, @command{keepalived}. Its value must be an +@code{keepalived-configuration} record as in this example for master +machine: + +@lisp +(service keepalived-service-type + (keepalived-configuration + (config-file (local-file "keepalived-master.conf")))) +@end lisp + +where @file{keepalived-master.conf}: + +@example +vrrp_instance my-group @{ + state MASTER + interface enp9s0 + virtual_router_id 100 + priority 100 + unicast_peer @{ 10.0.0.2 @} + virtual_ipaddress @{ + 10.0.0.4/24 + @} +@} +@end example + +and for backup machine: + +@lisp +(service keepalived-service-type + (keepalived-configuration + (config-file (local-file "keepalived-backup.conf")))) +@end lisp + +where @file{keepalived-backup.conf}: + +@example +vrrp_instance my-group @{ + state BACKUP + interface enp9s0 + virtual_router_id 100 + priority 99 + unicast_peer @{ 10.0.0.3 @} + virtual_ipaddress @{ + 10.0.0.4/24 + @} +@} +@end example +@end deffn + @node Unattended Upgrades @subsection Unattended Upgrades diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 9ec0f6a9ca..44754781c1 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2019 Sou Bunnbu ;;; Copyright © 2019 Alex Griffin ;;; Copyright © 2020 Brice Waegeneire +;;; Copyright © 2021 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,6 +43,7 @@ #:use-module (gnu packages admin) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages cluster) #:use-module (gnu packages connman) #:use-module (gnu packages freedesktop) #:use-module (gnu packages linux) @@ -192,7 +194,11 @@ yggdrasil-configuration-log-level yggdrasil-configuration-log-to yggdrasil-configuration-json-config - yggdrasil-configuration-package)) + yggdrasil-configuration-package + + keepalived-configuration + keepalived-configuration? + keepalived-service-type)) ;;; Commentary: ;;; @@ -1865,4 +1871,43 @@ See yggdrasil -genconf for config options.") (service-extension profile-service-type (compose list yggdrasil-configuration-package)))))) + +;;; +;;; Keepalived +;;; + +(define-record-type* + keepalived-configuration make-keepalived-configuration + keepalived-configuration? + (keepalived keepalived-configuration-keepalived ; + (default keepalived)) + (config-file keepalived-configuration-config-file ;file-like + (default #f))) + +(define keepalived-shepherd-service + (match-lambda + (($ keepalived config-file) + (list + (shepherd-service + (provision '(keepalived)) + (documentation "Run keepalived.") + (requirement '(loopback)) + (start #~(make-forkexec-constructor + (list (string-append #$keepalived "/sbin/keepalived") + "--dont-fork" "--log-console" "--log-detail" + "--pid=/var/run/keepalived.pid" + (string-append "--use-file=" #$config-file)) + #:pid-file "/var/run/keepalived.pid" + #:log-file "/var/log/keepalived.log")) + (respawn? #f) + (stop #~(make-kill-destructor))))))) + +(define keepalived-service-type + (service-type (name 'keepalived) + (extensions (list (service-extension shepherd-root-service-type + keepalived-shepherd-service))) + (description + "Run @uref{https://www.keepalived.org/, Keepalived} +routing software."))) + ;;; networking.scm ends here -- 2.29.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 12 06:42:38 2021 Received: (at 45589-done) by debbugs.gnu.org; 12 Jan 2021 11:42:38 +0000 Received: from localhost ([127.0.0.1]:59472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzI4L-0002Wk-Oz for submit@debbugs.gnu.org; Tue, 12 Jan 2021 06:42:38 -0500 Received: from mail-lf1-f41.google.com ([209.85.167.41]:39011) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzI4I-0002WM-Ao for 45589-done@debbugs.gnu.org; Tue, 12 Jan 2021 06:42:36 -0500 Received: by mail-lf1-f41.google.com with SMTP id a12so2890520lfl.6 for <45589-done@debbugs.gnu.org>; Tue, 12 Jan 2021 03:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=TtfWKXW+kMUbHBBb6sRJKKpA8hFj5csmvNMuPIPkm5s=; b=tp3sYPzjia6MTjlQrPE+jnpXwCI6jKMR2EDR6zUlMSqIrr7tddRw4HrAI0keLdC+dM cF9AzZ20+8vOLhYfWemO/o4ct8EeDEuDhMLnzZo+6pr0RADtiimSevhULcO0fGcVOmi8 xn03tU/RNbaoEzJAt2NZA1v9BZvCjeKK0Ym/NnG3ytuBEQy8VPgMC4yk9cwx1Yt7aLHl pU0uV0L0Ui1x8VVc8EfqKRs8+jx+seOEZHc6338ZFuEN8ZLoMcpVTqZEBW0gV6EPl4Qs QTe17acRxW+hWqgFd554+jk4ovzr6oyQnv3sem5VXwSoa967cwGqQcuHeFB/FauQsyw0 wkOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=TtfWKXW+kMUbHBBb6sRJKKpA8hFj5csmvNMuPIPkm5s=; b=ZolN6q/F5OnTfLjjbTuQJuRyvHvFvro3s0fUAyGRDZa98XcddE3Hi6yRQJy3ZUAG7v lcqFnH08mH3f/aU0TO1ggD9sdvRo3Z5I2n5Uyicq95Coj6dS5FfGFM/GJBiU4suRmNNS CLYdoaJKNKNQFHER5fO6tmNcoWw21sTFjMyI4Sixv+ioc72WGxUkMjC0gEf+sE16hPII 4Fcmiv6flrqKcWOfgZSSskC7zxiaEjuLRvXsNCrak6h/4OqHyV6J33nbnVuVivjVC0DT 2OUjrxxQBpc2lgkAMA9QWN4pLt7wfi6FHD5ARoFCBv/7r+iIY0iGtFJNgfJVAoncAnyU ma+g== X-Gm-Message-State: AOAM5307z6LdJvjtmPiSSMXZs2wPsiAJjfa+1bvu8UYs2vW/DWtrL4w8 oRWgpGD+0tX3imnK6aM24jdZ9+kDOgQ= X-Google-Smtp-Source: ABdhPJyO+xyMKWdwU/NeuQShXpY+1UxT43S0vRkMoSqzuHplW1BYgSFLIZkO6uqNdwHEX53SVokGwg== X-Received: by 2002:a19:8c15:: with SMTP id o21mr2046178lfd.101.1610451747897; Tue, 12 Jan 2021 03:42:27 -0800 (PST) Received: from guixsd ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id z141sm362167lfc.118.2021.01.12.03.42.26 for <45589-done@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 03:42:26 -0800 (PST) From: Oleg Pykhalov To: 45589-done@debbugs.gnu.org Subject: Re: bug#45589: Acknowledgement ([PATCH] services: Add keepalived service.) References: <20210101101421.9847-1-go.wigust@gmail.com> Date: Tue, 12 Jan 2021 14:42:04 +0300 In-Reply-To: (GNU bug Tracking System's message of "Fri, 01 Jan 2021 10:15:01 +0000") Message-ID: <871req756b.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 45589-done 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 (-) --=-=-= Content-Type: text/plain Pushed to master. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAl/9iwwUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+pw5WQ//ZlQkGAalC29O49wFRp+OIqysD7oh 3qNYfAZdg4jG0PqGdCn5tvMOSkavLE5Pb1oIaog+VZGraw2kS7wCOtlr6dkGQzhM Fe4nKDzyO+zqQgyfJtF3sZnoN0sWfk0Eu/j6vB+zEej55yoIjfoKfE56KOlcDxwH 7kDavWT7jkH6BUWoEfZQfkfTSydoY1n7lKvNgmldiTVBT0GvnkJtrCqdFLSFOcqy oi3H7EiFxgFG7i04awt1rlXHuJcEHQuG3kW08fren0Su9mCtNWJhU1YZXAhuuj+4 Jum4C/SZIm5lvyvItmbacX3ieBigL1ArXdfyQtPZAyntnxQhs99+SkRplC6I7CUy ffQ439hEXBuKSCsVB6/tuTe1d2Kt6AFOpiY9EKnHNk1wydj+t01rXtr6U7lYtFnc ALyFimq1jEul0xp/wd0rODRGs0MEbjM2Kyl+WM0O3T5AFIOQ4rBh3gGH6w7xz9qp QO6CDfz8dsTbR/4OhvQgDN9r3zfSW/ovzzKiechW5g0bn8wXmMTNAv7OvBYix/ya Y4hwTnD2jO20nIYPuVkWd7TZA84jVZx170VztE7qKWzPyEXAKojq+0RSMIFKlSS2 zYqJN95dm3KxP4d+e0D++v+/J5/AYcZaLC9TutwuXTWSQq3i/DzDQQWEGkP40Afb NNCrwm6pk4Xzoj4= =QUwd -----END PGP SIGNATURE----- --=-=-=-- From unknown Thu Sep 11 15:11:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 09 Feb 2021 12:24:13 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator