From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kMz3Dws7c2AaSAAAgWs5BA (envelope-from ) for ; Sun, 11 Apr 2021 20:08:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UHrlCQs7c2D4KQAA1q6Kng (envelope-from ) for ; Sun, 11 Apr 2021 18:08:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 553E911D7F for ; Sun, 11 Apr 2021 20:08:09 +0200 (CEST) Received: from localhost ([::1]:47566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVeVE-00008f-7t for larch@yhetil.org; Sun, 11 Apr 2021 14:08:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVeV8-00008C-1k for guix-patches@gnu.org; Sun, 11 Apr 2021 14:08:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44307) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lVeV7-0002EJ-RH for guix-patches@gnu.org; Sun, 11 Apr 2021 14:08:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lVeV7-00036I-M0 for guix-patches@gnu.org; Sun, 11 Apr 2021 14:08:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47704] [PATCH] services: mysql: Add extra-environment as configuration option. Resent-From: david larsson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Apr 2021 18:08: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: Maxime Devos Cc: 47704@debbugs.gnu.org Received: via spool by 47704-submit@debbugs.gnu.org id=B47704.161816445311883 (code B ref 47704); Sun, 11 Apr 2021 18:08:01 +0000 Received: (at 47704) by debbugs.gnu.org; 11 Apr 2021 18:07:33 +0000 Received: from localhost ([127.0.0.1]:55853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVeUf-00035b-D5 for submit@debbugs.gnu.org; Sun, 11 Apr 2021 14:07:33 -0400 Received: from server0.selfhosted.xyz ([217.64.149.7]:60592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVeUc-00035K-SQ for 47704@debbugs.gnu.org; Sun, 11 Apr 2021 14:07:32 -0400 Received: from server0.selfhosted.xyz (localhost [127.0.0.1]) by server0.selfhosted.xyz (Postfix) with ESMTP id 9BA581D09FB8; Sun, 11 Apr 2021 20:07:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=selfhosted.xyz; s=dkim; t=1618164441; bh=xGrzip8cYdD8fq9ns3hViPvS1MusnSJ5p6rQZMiFoTQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Iuf9yJHd5O7baZ8t3bVyZzNFvfzusO7B+vJRDS9fz52wjtJ3UeGASNRi1LgHviVL7 1AbmIqKyLxM1r/av1BDn1ZhybYjieAHtSaX/aUFVXgONjhjytFdsE4+NJRg1dAlXWp QJkSUM9SLpFSKiIgA0oTvz5P+bU6Pl4TJEW6fr2oHH4NS130C+2Av7oXT/xfSTW0hY ksL0GwKYpwGZR82REj4JzsCuqw2VEdu2pFhz8amZ440o3BND0DO7gH/NpkBmODew85 IoZ/qvFZDKOkDhqKapkbJlb4qefQ4WRR+zUBZ/FBdfrmyQxsJhhBmqXw78Q2BxXJVI 5oOdfIK80gh4g== X-Fuglu-Suspect: a54c7072ac974b14a944803a6fe1bb2a X-Fuglu-Spamstatus: NO Received: from webmail.selfhosted.xyz (office.selfhosted.xyz [192.168.1.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mail@selfhosted.xyz) by server0.selfhosted.xyz (Postfix) with ESMTPSA; Sun, 11 Apr 2021 20:07:15 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 11 Apr 2021 20:07:15 +0200 From: david larsson In-Reply-To: References: <91c1726e12b938f7656d7d7862920f69@selfhosted.xyz> Message-ID: <7d2d1250a3e87ac67c80897bffe0b82c@selfhosted.xyz> X-Sender: david.larsson@selfhosted.xyz 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=1618164490; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=xGrzip8cYdD8fq9ns3hViPvS1MusnSJ5p6rQZMiFoTQ=; b=hh6xExpl1wsn22RithUt7H53MxKZoA/BPfjfAJoEvVyfcJZVwgmC0EeCa6VQb33oAS7snp Ld3bQoHC9nhJBPpkL4v3yrHU8rP+XovnOXNPja+WM3WfKctYuOAnrQ3InILE0iUYclwfMd 5T8sD2Mel0PrmTGf8L/NIRh6VRYd3cya+4lN5pE4k/uCpzJ4ENJGX0sgNeDTXKESiVja00 ccb9K+Y3E0qn+6O685qxRw0IsHyDp0hetwOiSErnU1FxeKO/Kxygw3sH/4So1p6fB354AJ m9vBORTleHVuj36gABlADlXSALoUfbl04swsb8WpQ1tjuKTWeTRmOI1+S29LiA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618164490; a=rsa-sha256; cv=none; b=ZExMmhdqtAghpitwqnJCfD4+BAqe+mXd7kiTlToCMgsg9GXyS3dO3YfrbcrLZV1w3u0lDt nJXSDfwXggYZTz6BkXSjSus4sMlVsddSAShpMt7BycGLFJVt2zRoMpGAzbMLLSiEQveYO5 CzUmRg7PFwJ9G7ju2JkH3elZxd6z2rN848zC9Juh96c2UGusdNSaS9zfFfrJxaJEG/lfLe HNKRbMiqCvnVts0Z4m0WhSCS3KZwc2kgZBsuInA6Y8IRa8SlAkJ/6ixcF/gFnwQ6JgFBuZ auh+TBDfraDjV3tB0X7PUiWtgHabo4vRu2yVxWeylIZS+1Mxu776OPNWd7wJKQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=selfhosted.xyz header.s=dkim header.b=Iuf9yJHd; 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: 0.17 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=selfhosted.xyz header.s=dkim header.b=Iuf9yJHd; dmarc=fail reason="SPF not aligned (relaxed)" header.from=selfhosted.xyz (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: 553E911D7F X-Spam-Score: 0.17 X-Migadu-Scanner: scn0.migadu.com X-TUID: WYIZ9JI3Nl+1 Hi Maxime! On 2021-04-11 17:33, Maxime Devos wrote: > 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") is > incorrect when cross-compiling; > > That way, people don't have to fiddle with PATH in their configuration > file. I think you misundestood here - these rsync, gawk, iproute etc are executed as part of scripts in the mysqld/bin package output folder (see `ls -la $(dirname $(readlink -f $(which mysqld)))/` ) because the Galera add-on was (at least partially) merged into the regular mariadb sources, so the scripts where the binaries are needed are not from the galera package outputs but the mysql one. The galera package in guix master today only provides the #$galera "/lib/libgalera_smm.so file. I agree it would be nice to patch all the shell scripts in the $#mysql/bin folder but this would 1. require maintaining all the additional patching of those scripts as part of the mysql package and 2. since custom wsrep_sst_ shell scripts are possible and are usually added to /usr/bin/wsrep_sst_ those binaries will also require setting additional environment variables or the same type of patching (which would therefore "require" this patch to make it easier). > If possible, consider writing a "system test" automatically testing > some very basic functionality of mariadb + galera > (gnu/tests/databases.scm). I would have liked to, but Im sorry - I do not have the time/skill for this for the time being. I hope the current patch is simple enough that an additional test is not currently needed. >> I ran these commands to test: >> guix pull --url=/home/user1/src/guix --profile=/tmp/guix.master >> --disable-authentication --allow-downgrades ; >> GUIX_PROFILE="/tmp/guix.master" ; . "$GUIX_PROFILE/etc/profile" ; guix >> system reconfigure config.scm --fallback --allow-downgrades >> >> ------------------------------------------------------------------ >> >> (extra-environment #~(list ... >> >> "USER=mysql" >> "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt" >> "SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs")) > > It seems extra-environment is still useful. "USER=mysql" should > probably be > added automatically, though (see my proposal below). Yes, in particular for custom wsrep scripts. The "USER=mysql" may not be needed per se for the example snippet config I sent earlier as I did not make sure that the list of environment variables there were the minimal amount needed; I mainly hoped to provide a repeatable example of something to test with. > 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 > entries > 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. This looks nice! I agree that something like what you show here is the better option, at the same time I don't have the time/skill to provide a patch with a well-featured interface to the galera options for the time being. The "escape hatch" would therefore be very useful for now, and less hassle to maintain - compare with for example the vpn service and the amount of emails in the lists regarding lack of options that could have easily been added via some g-expression strings. In general I don't see the harm in providing both "the escape hatch" way to add options to a configuration file and the guile interface which is otherwise nicer (IMO). >> ------------------------------------------------------------------ >> >> Please someone also review [bug#47517] [PATCH] gnu: nginx: Enable >> stream >> module > > I'll take a look at it. Thanks! Best regards, David