From patchwork Sun Dec 12 18:28:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brice Waegeneire X-Patchwork-Id: 494 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id EC34A27BBEA; Sun, 12 Dec 2021 18:29:08 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B06D827BBE9 for ; Sun, 12 Dec 2021 18:29:08 +0000 (GMT) Received: from localhost ([::1]:43906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwTat-0000hz-P6 for patchwork@mira.cbaines.net; Sun, 12 Dec 2021 13:29:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwTao-0000hb-CN for guix-patches@gnu.org; Sun, 12 Dec 2021 13:29:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwTao-0007lc-4E for guix-patches@gnu.org; Sun, 12 Dec 2021 13:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mwTao-0003c3-1p for guix-patches@gnu.org; Sun, 12 Dec 2021 13:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52454] [PATCH 0/4] Ensure correct ownership of directory trees in services.Hello Guix, Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 12 Dec 2021 18:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52454 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52454@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163933373013869 (code B ref -1); Sun, 12 Dec 2021 18:29:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Dec 2021 18:28:50 +0000 Received: from localhost ([127.0.0.1]:53074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwTac-0003bd-2O for submit@debbugs.gnu.org; Sun, 12 Dec 2021 13:28:50 -0500 Received: from lists.gnu.org ([209.51.188.17]:45562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwTaa-0003bV-Bu for submit@debbugs.gnu.org; Sun, 12 Dec 2021 13:28:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwTaa-0000hR-5y for guix-patches@gnu.org; Sun, 12 Dec 2021 13:28:48 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:51521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwTaY-0007jv-7Z for guix-patches@gnu.org; Sun, 12 Dec 2021 13:28:47 -0500 Received: (Authenticated sender: brice@waegenei.re) by relay10.mail.gandi.net (Postfix) with ESMTPSA id AA6E3240003 for ; Sun, 12 Dec 2021 18:28:40 +0000 (UTC) From: Brice Waegeneire Date: Sun, 12 Dec 2021 19:28:35 +0100 Message-ID: <87h7bdad9o.fsf@waegenei.re> MIME-Version: 1.0 Received-SPF: pass client-ip=217.70.178.230; envelope-from=brice@waegenei.re; helo=relay10.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello Guix, A number of times I got hit by newly configured service not starting because of wrong ownership for files they ought to own. This appear when reconfiguring a operating system with a service that was unsed in the past, but not present in previous generation. For example, this time, cuirass and postgresql service wouldn't start because that system had them running before, but a few weeks ago I reconfigured the operating system without them and now that I want to have these services running again they won't start because the activation scripts were only changing the ownership of the runtime, data, log and co. directories but not their content. Concretely /var/lib/postgresql/data/PG_VERSION (and others) wasn't owned by postgresql:postgresql but by an other pair of UID/GID, however /var/lib/postgresql had the correct ownership This patch fix such UID/GID mismatch for the cuirass and postgresql service by recusrivly changing the owner and group of the whole tree these services need. And not just the root directories of theses trees. It is related to the issue about stable UID/GID in Guix's containers. Cheers, - Brice Brice Waegeneire (4): syscalls: Add 'lchown'. activation: Add 'lchown-recursive'. services: postgresql: Ensure correct ownership of directory trees. services: cuirass: Ensure correct ownership of directory trees. gnu/build/activation.scm | 22 ++++++++++++++++++++-- gnu/services/cuirass.scm | 18 +++++++++++------- gnu/services/databases.scm | 14 +++++++++----- guix/build/syscalls.scm | 16 ++++++++++++++++ 4 files changed, 56 insertions(+), 14 deletions(-) base-commit: 604880ae22e1a7662acb1d3f282242470de0cd03