guix/gnu/services
Martin Baulig 9dda747975
services: posgresql: 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.

* gnu/services/databases.scm (<postgresql-configuration>)[create-account?]
[uid, gid]: New fields.
(%postgresql-accounts): Remove.
(create-postgresql-account): New procedure.
(postgresql-service-type)[extensions]: Use it.
* doc/guix.texi (Database Services): Update accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-16 22:37:52 +02:00
..
admin.scm
audio.scm
auditd.scm
authentication.scm
avahi.scm
base.scm
certbot.scm
cgit.scm
ci.scm
configuration.scm
cuirass.scm
cups.scm
databases.scm services: posgresql: Add option to specify UID/GID for postgres user. 2023-08-16 22:37:52 +02:00
dbus.scm
desktop.scm gnu: elogind: Update to 252.9. 2023-08-16 11:24:10 -04:00
dict.scm
dns.scm
docker.scm
file-sharing.scm
games.scm
ganeti.scm
getmail.scm
guix.scm
herd.scm
hurd.scm
kerberos.scm
ldap.scm
lightdm.scm
linux.scm services: Add cachefilesd service. 2023-08-15 23:30:44 +02:00
lirc.scm
mail.scm
mcron.scm
messaging.scm
monitoring.scm
networking.scm
nfs.scm
nix.scm
pam-mount.scm
pm.scm
rsync.scm
samba.scm
science.scm
sddm.scm
security-token.scm
security.scm
shepherd.scm
sound.scm
spice.scm
ssh.scm
syncthing.scm
sysctl.scm
telephony.scm
version-control.scm
virtualization.scm
vnc.scm
vpn.scm
web.scm
xorg.scm