xref: /unit/pkg/deb/debian/unit.postinst (revision 1753:7d8644d56ed5)
1#!/bin/sh
2
3set -e
4
5if [ "$1" != "configure" ]; then
6    exit 0
7fi
8
9if [ -n "$2" ]; then
10    if dpkg --compare-versions "${2%%-*}" le "1.21.0"; then
11      cat <<BANNER
12----------------------------------------------------------------------
13
14WARNING:
15
16Since version 1.22.0, Unit's non-privileged processes run as unit:unit by
17default.  Review your system permissions and Unit configuration so apps and
18routes that relied on these processes running as nobody:nogroup stay working.
19
20More info: https://unit.nginx.org/installation/#official-packages
21
22----------------------------------------------------------------------
23BANNER
24    fi
25fi
26
27if ! getent group unit >/dev/null; then
28    addgroup --system unit >/dev/null
29fi
30
31if ! getent passwd unit >/dev/null; then
32    adduser \
33      --system \
34      --disabled-login \
35      --ingroup unit \
36      --no-create-home \
37      --home /nonexistent \
38      --gecos "unit user" \
39      --shell /bin/false \
40      unit >/dev/null
41fi
42
43#DEBHELPER#
44
45exit 0
46