From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6Nk1DQMXc2BzCgAAgWs5BA (envelope-from ) for ; Sun, 11 Apr 2021 17:34:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SJ0iBwMXc2B7QAAA1q6Kng (envelope-from ) for ; Sun, 11 Apr 2021 15:34:27 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9425B8FAC for ; Sun, 11 Apr 2021 17:34:26 +0200 (CEST) Received: from localhost ([::1]:52574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVc6T-00071I-MO for larch@yhetil.org; Sun, 11 Apr 2021 11:34:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVc66-000702-7l for guix-patches@gnu.org; Sun, 11 Apr 2021 11:34:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lVc66-0007Tr-05 for guix-patches@gnu.org; Sun, 11 Apr 2021 11:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lVc65-0007tn-Ry for guix-patches@gnu.org; Sun, 11 Apr 2021 11:34:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47704] [PATCH] services: mysql: Add extra-environment as configuration option. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Apr 2021 15:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47704 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: david larsson , 47704@debbugs.gnu.org Received: via spool by 47704-submit@debbugs.gnu.org id=B47704.161815519230307 (code B ref 47704); Sun, 11 Apr 2021 15:34:01 +0000 Received: (at 47704) by debbugs.gnu.org; 11 Apr 2021 15:33:12 +0000 Received: from localhost ([127.0.0.1]:55750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVc5I-0007sl-72 for submit@debbugs.gnu.org; Sun, 11 Apr 2021 11:33:12 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:38444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVc5F-0007sY-2s for 47704@debbugs.gnu.org; Sun, 11 Apr 2021 11:33:10 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id rTZ7240070mfAB401TZ7bD; Sun, 11 Apr 2021 17:33:07 +0200 Message-ID: From: Maxime Devos Date: Sun, 11 Apr 2021 17:33:01 +0200 In-Reply-To: <91c1726e12b938f7656d7d7862920f69@selfhosted.xyz> References: <91c1726e12b938f7656d7d7862920f69@selfhosted.xyz> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-OGB/jXZmRIIb+Z+/SZ7D" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1618155187; bh=nzWQkFp8fsuNNjEuxZBiRikhSBLVInF/GUXQ1e8QBls=; h=Subject:From:To:Date:In-Reply-To:References; b=ICCwjfUNnd6QxNusXiq+4qVBcV1j7hY0fmX/GC4WD5PPOsCWAZPx0JuG4fnxV4WcR ixOXh+PtdHMdfhgU4+Ju6vt2ng1oWNORnXEVHMvXxPCXA9LErrqRdjYMqP6HE03Xjj ytVANCOCkf0fMtNuNXuywwLZrOA8cjp9IRB6ZdwoZML6ZgjgPt+7dU7D44ktSFcer3 UdhumIXaO6UpfE4tU+BV+OLGQ1pnS0UZf/jWFza5XV0G/5+ECsgTNt6YTRWInno6JO Xp05A1hApD0SA7DqdpML9ldmi4INkgY5AIU21rDjAfZ5O/bN4kbO5P4Ji412AyZTp8 D9P2rXlIuCySg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618155266; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=nzWQkFp8fsuNNjEuxZBiRikhSBLVInF/GUXQ1e8QBls=; b=pwbxMRfjMwFMWwLjhillI43SJWX5AgozfLOP4u9Tdd2NNeANPk4+JGNIP4VYDGu1F/jW6I vYs5j+xjLbRQlRJTrRqGuLly08ENKefjmHzCuEJ9WbSt6B+eRYspBCU43jNsdqcm8CMeMC BVEAFdqW965NLBYxyX2XSx8s8cRhhz41POFudg6GV3ckde0CVnrkYjQptSlExAYZDFOAjH YGlefjudJw+XSWulDeNVuXWeGEiTNQaO+qyPRolUXSMgZwy/Dua7N9a/LvNLrSHSRIEGCW dF3W+oq0IU42JJZ37437pW3746D7FRpA3/Zl7GWrgDpXI8qajlLmsq7UFiUzdA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618155266; a=rsa-sha256; cv=none; b=tkyE39ZQi4l2zuaY5nQ5FEjWL3zXSUHinXiwpVx2k5Qo1gkiduN5RTn72Pmp2gSbDTJGys wWngD69Z3tZl6DaZC9OyUTkx7pOC2bivwLBIxxBSv1I3JsF/ECzpd/HcZ/+ZxfPPy4RZkg 0n04XUiaT3+2fAZRMOFvbv59UzEiZuVZFVuNQU80KbdSFPygT8eaLRqyBZJE51bjgftLLI YFpGR4CJKz62IZKp/rvxRijTA08gaOdyKUPBVRIB9Zj5baWEqpf/VNmqmhm9SPnJepw0D0 zSeSTQhkAptl/MEalEROu6m3w5503uO0Xo2lBLywuOKlJFC1CPXx+5JlVsDT9w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=ICCwjfUN; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.94 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=ICCwjfUN; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 9425B8FAC X-Spam-Score: -1.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: Zgc8r6bVFiQg --=-OGB/jXZmRIIb+Z+/SZ7D Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 2021-04-11 at 10:44 +0200, david larsson wrote: > Hi! > This patch is needed for the Galera add-on to MariaDB, which runs some= =20 > scripts like for example wsrep_sst_rsync that needs access to additional= =20 > binaries in PATH. > [... reordered ...] > (extra-environment #~(list (string-append "PATH=3D/usr/bin:/bin:" #$rsync= =20 > "/bin:" #$coreutils "/bin:" #$gawk "/bin:" #$grep "/bin:" #$mariadb=20 > "/bin:" #$iproute "/sbin:"=20 > "/ Please corect the galera package to refer to the coreutils (ls, stat, ...) by absolute file name instead, using something like (add-after 'install (substitute* "INSTALL-LOCATION/wsrep_sst_rsync" (("\\bls\\b") (string-append (assoc-ref inputs "coreutils") "/bin/ls")) ...)) (Likewise for rsync, gawk, iproute ...) Don't use (which "ls") instead of string-append + assoc-ref! (which "ls") i= s incorrect when cross-compiling; That way, people don't have to fiddle with PATH in their configuration file= . > I tested the patch with (and without) below snippets to the=20 > mysql-service in my config.scm and successfully connected to a=20 > MariaDB/Galera cluster. If possible, consider writing a "system test" automatically testing some very basic functionality of mariadb + galera (gnu/tests/databases.scm)= . > I ran these commands to test: > guix pull --url=3D/home/user1/src/guix --profile=3D/tmp/guix.master=20 > --disable-authentication --allow-downgrades ;=20 > GUIX_PROFILE=3D"/tmp/guix.master" ; . "$GUIX_PROFILE/etc/profile" ; guix= =20 > system reconfigure config.scm --fallback --allow-downgrades >=20 > ------------------------------------------------------------------ >=20 > (extra-environment #~(list ... > > "USER=3Dmysql"=20 > "SSL_CERT_FILE=3D/etc/ssl/certs/ca-certificates.crt"=20 > "SSL_CERT_DIR=3D/run/current-system/profile/etc/ssl/certs")) It seems extra-environment is still useful. "USER=3Dmysql" should probably= be added automatically, though (see my proposal below). >=20 > (extra-content #~(string-append "log_error=3D/var/lib/mysql/log_error.log > #=20 > https://www.percona.com/blog/2017/07/26/what-is-innodb_autoinc_lock_mode-= and-why-should-i-care/ > binlog_format=3DROW > default-storage-engine=3Dinnodb > innodb_autoinc_lock_mode=3D2 >=20 > # Galera Provider Configuration > wsrep_on=3DON > wsrep_provider=3D" #$galera "/lib/libgalera_smm.so >=20 > # Galera Cluster Configuration > wsrep_cluster_name=3D\"test_cluster\" > wsrep_cluster_address=3D\"gcomm://redacted,redacted\" > # according to=20 > https://galeracluster.com/library/documentation/mysql-wsrep-options.html > # leaving it empty starts a new cluster, so you should immediately=20 > reconfigure again after doing this. > #wsrep_cluster_address=3D\"gcomm://\" >=20 > # Galera Synchronization Configuration > wsrep_sst_method=3Drsync >=20 > # Galera Node Configuration > wsrep_node_address=3D\"redacted\" > wsrep_node_name=3D\"librem13v3guixsd\"")) > )) Perhaps you could extend "mysql-configuration" with a "galera" field (with #f as default)? Theoretical example: (mysql-configuration (port A-DIFFERENT-PORT) ;; [...] other fields (galera (package my-version-of-galera) ; optional (cluster-name "test_cluster") (cluster-address "gcom://...") (synchronization-method 'rsync) (node-adress "redacted") (node-name "librem13v3guixsd"))) .. and modify mysql-service-type to insert appropriate configuration entrie= s and perhaps add things to the PATH of the shepherd service as appropriate. Escape hatches like "extra-content" are useful, but this seems a bit neater. > ------------------------------------------------------------------ >=20 > Please someone also review [bug#47517] [PATCH] gnu: nginx: Enable stream= =20 > module I'll take a look at it. Greetings, Maxime.=20 --=-OGB/jXZmRIIb+Z+/SZ7D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYHMWrRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ktzAP9Kkf6RoBHbkGmFNTbwbC940xhH V8t0U4rW8DjiwuH0WAD/UgcUarIcTtNxZS86B+sl+P0I/h7gfZxdWPqE8tcnJww= =JcEP -----END PGP SIGNATURE----- --=-OGB/jXZmRIIb+Z+/SZ7D--