Re: How do the Linux distributions create the Linux user/group "postgres"?

From: Matthias Apitz <guru(at)unixarea(dot)de>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How do the Linux distributions create the Linux user/group "postgres"?
Date: 2023-01-09 13:27:19
Message-ID: 20230109132719.GA9@sh4-5.1blu.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

El día Montag, Januar 09, 2023 a las 08:15:33 -0500, Joe Conway escribió:

> On 1/9/23 07:41, Matthias Apitz wrote:
> > Please note: I'm talking about the user and group "postgres" in the
> > Linux OS and not in the PostgreSQL server.
> >
> > We're compiling PostgreSQL from source (actually 14.1) and distribute that
> > to our customers. They're asked to setup user and group "postgres"
> > before creating the cluster. As nowadays there are a lot of setup such
> > things in bigger installations, like LDAP or AD, etc. I'd like to know
> > how other installations for Linux deal with this?
>
> See for example the PGDG RPM spec file:
>
> https://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=rpm/redhat/main/non-common/postgresql-15/main/postgresql-15.spec;h=60cd42147a7563ba76c401643d0a7c79b59d2520;hb=HEAD
>
> 8<-------------------
> %pre server
> groupadd -g 26 -o -r postgres >/dev/null 2>&1 || :
> useradd -M -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
> -c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || :
> 8<-------------------

From the useradd(8) man page:

CAVEATS
You may not add a user to a NIS or LDAP group. This must be performed on the
corresponding server.

Similarly, if the username already exists in an external user database such as
NIS or LDAP, useradd will deny the user account creation request.

--
Matthias Apitz, ✉ guru(at)unixarea(dot)de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2023-01-09 14:11:35 Re: How do the Linux distributions create the Linux user/group "postgres"?
Previous Message Erik Wienhold 2023-01-09 13:18:01 Re: How do the Linux distributions create the Linux user/group "postgres"?