From 16f9f0de85fd8a19ed735cc87cb9844dd4b52ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 22 Jul 2019 19:57:36 +0200 Subject: 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 --- main/postgresql/postgresql.pre-install | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 main/postgresql/postgresql.pre-install (limited to 'main/postgresql/postgresql.pre-install') diff --git a/main/postgresql/postgresql.pre-install b/main/postgresql/postgresql.pre-install new file mode 100644 index 0000000000..dd34706224 --- /dev/null +++ b/main/postgresql/postgresql.pre-install @@ -0,0 +1,10 @@ +#!/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 -- cgit v1.2.3