GNU bug report logs - #64786
[PATCH]: services: databases: add option to specify UID / GID for the postgres user

Previous Next

Package: guix-patches;

Reported by: Martin Baulig <martin <at> baulig.is>

Date: Sat, 22 Jul 2023 07:55:03 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64786 in the body.
You can then email your comments to 64786 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#64786; Package guix-patches. (Sat, 22 Jul 2023 07:55:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Martin Baulig <martin <at> baulig.is>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 22 Jul 2023 07:55:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Martin Baulig <martin <at> baulig.is>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [PATCH]: services: databases: add option to specify UID / GID for the
 postgres user
Date: Sat, 22 Jul 2023 00:27:19 +0000
[Message part 1 (text/plain, inline)]
Hello,

This is my first contribution to GNU Guix, and I hope this patch is in the correct format.

Attached is a small patch to gnu/services/databases.scm that adds an option to explicitly
specify the UID / GID for the postgres user, as well as an option not to create the service
account at all.

I added some documentation as well and provided a detailed reasoning and background
in the commit message.

Hope this is useful and looking forward to hearing back to you,

Martin
[Message part 2 (text/html, inline)]
[0001-services-databases-Add-option-to-specify-UID-GID-for.patch (application/octet-stream, attachment)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 16 Aug 2023 20:45:01 GMT) Full text and rfc822 format available.

Notification sent to Martin Baulig <martin <at> baulig.is>:
bug acknowledged by developer. (Wed, 16 Aug 2023 20:45:02 GMT) Full text and rfc822 format available.

Message #10 received at 64786-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Martin Baulig <martin <at> baulig.is>
Cc: 64786-done <at> debbugs.gnu.org
Subject: Re: bug#64786: [PATCH]: services: databases: add option to specify
 UID / GID for the postgres user
Date: Wed, 16 Aug 2023 22:44:22 +0200
Hi Martin,

Martin Baulig <martin <at> baulig.is> skribis:

> From ae2534f6cc8611483a11f7a934777a03bd194a27 Mon Sep 17 00:00:00 2001
> From: Martin Baulig <martin <at> baulig.is>
> Date: Mon, 17 Jul 2023 18:13:42 -0400
> Subject: [PATCH] services: databases: Add option to specify UID / GID for
>  postgres user.
>
> Add 'createAccount?', 'uid' and 'gid' to <postgresql-configuation>.
>
> Unlike other system daemons, the PostgreSQL data directory is typically
> meant to persist across 'guix system reconfigure' and once created, you
> don't want it's UID or GID to change anymore.
>
> Furthermore, if you want to place the data directory on a network share
> and use NFSv4 with idmap, then the 'postgres' user must exist when the
> 'rpc.idmapd' daemon is launched; prior to mounting the share.  And it
> needs to be possible to mount the share without configuring PostgreSQL.
>
> With NFSv3, the UID and GID typically needs to match those on the
> server.
>
> The added options allow for both of these scenarios:
>
> You can either create the user in (operating-system (users)) completely
> independently of the 'postgresql-service-type' (for instance to get your
> NFS setup working first prior to configuring your databases) - or "pin"
> it's UID / GID values.

This look very useful.  I wish this situation could be handled in a more
automatic way somehow, but at least this patch lets admins handle it
“manually” as you write, and that’s a great improvement.

I expanded the commit log to match the conventions as noted in
<https://guix.gnu.org/manual/devel/en/html_node/Submitting-Patches.html>
and applied it.

Thank you, and welcome!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 14 Sep 2023 11:24:16 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.