diff options
Diffstat (limited to 'extra/postgresql/postgresql.install')
-rw-r--r-- | extra/postgresql/postgresql.install | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/extra/postgresql/postgresql.install b/extra/postgresql/postgresql.install new file mode 100644 index 000000000..4a6f9b848 --- /dev/null +++ b/extra/postgresql/postgresql.install @@ -0,0 +1,14 @@ +post_install() { + getent group postgres >/dev/null || groupadd -g 88 postgres + getent passwd postgres >/dev/null || useradd -c 'PostgreSQL user' -u 88 -g postgres -d '/var/lib/postgres' -s /sbin/nologin postgres + passwd -l postgres >/dev/null +} + +post_upgrade() { + post_install $1 +} + +post_remove() { + getent passwd postgres >/dev/null && userdel postgres + getent group postgres >/dev/null && groupdel postgres +} |