mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-16 22:22:12 +01:00
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
11 lines
299 B
Bash
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
|