summarylogtreecommitdiffstats
path: root/trafficserver.install
blob: bfd035fb06a0db68609c308ed97c1e33657e4d4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
_missing_user_message="This package requires that the 'trafficserver' OS user
and group exist when installing this package and that it must match the UID and
GID of the server that built the package.  This package uses systemd-sysusers
as other arch packages do. Run the following command as root before building
this package, replacing <UID:GID> with the values from the package build
machine.

    # echo 'u trafficserver <UID:GID> \"Apache Traffic Server\"' | \
          systemd-sysusers --replace=/usr/lib/sysusers.d/trafficserver.conf -

Note that the UID and GID assigned must match on the arch install where the
package will be installed.

This ensures that the post install steps do not clobber administrator defined
or existing cache ownership at the expense of requiring the trafficserver user
be defined the same way on the package build server and package deployment
host.  See https://bbs.archlinux.org/viewtopic.php?id=241480"

pre_install() {
    if ! (getent passwd trafficserver || getent group trafficserver); then
        echo "$_missing_user_message"
        return 1
    fi

}

post_upgrade() {
    # There are configuration changes required when upgrading to major
    # version 9.
    if [[ "${2%%.*}" -lt 8 ]]; then
        echo 'Please review your configuration when upgrading to v9:'
        echo ' https://docs.trafficserver.apache.org/en/9.0.x/release-notes/upgrading.en.html'
    fi
}

post_remove() {
    echo 'Traffic Server log files and cache files must be cleaned up manually.'
}