aports/main/postgresql/postgresql.pre-install
Sören Tempel 16f9f0de85 main/postgresql: create postgres account
This change was made due to complains that /etc/passwd contains system
accounts with login shells, postgres being one of them [0].

Setting the shell of the postgres account to /sbin/nologin was not
deemed feasible as the official document suggests login in as the
postgres user via su(1) [1]. Other Linux distribution (Debian, Gentoo,
Arch) also create the account with a shell.

Not creating the postgres account by default (via alpine-baselayout) and
instead creating it on demand from the package was deemed a reasonable
compromise.

[0]: https://gitlab.alpinelinux.org/alpine/aports/issues/10579
[1]: https://wiki.postgresql.org/wiki/First_steps
2019-07-23 11:27:10 +02:00

11 lines
299 B
Bash

#!/bin/sh
# Fixed GID/UID values as this users was previously included in the
# default /etc/passwd as shipped by main/alpine-baselayout.
addgroup -g 70 -S postgres 2>/dev/null
adduser -u 70 -S -D -H -h /var/lib/postgresql -g "Postgres user" \
-s /bin/sh -G postgres postgres 2>/dev/null
exit 0