File: haproxy.postinst

package info (click to toggle)
haproxy 3.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 23,764 kB
  • sloc: ansic: 266,082; sh: 3,275; xml: 1,756; python: 1,345; makefile: 1,152; perl: 168; cpp: 21
file content (22 lines) | stat: -rw-r--r-- 650 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

set -e

adduser --system --disabled-password --disabled-login --home /var/lib/haproxy \
        --no-create-home --quiet --force-badname --group haproxy

#DEBHELPER#

if [ -n "$2" ]; then
	if dpkg --compare-versions "$2" lt "1.8.0-1~" && [ -d /run/systemd/system ]; then
		# Do a full restart when upgrading to 1.8 series on systemd, as
		# the systemd wrapper is no longer there.
		invoke-rc.d haproxy restart || true
	elif dpkg --compare-versions "$2" gt "1.5~dev24-2~"; then
		# Reload already running instances. Since 1.5~dev24-2 we do not stop
		# haproxy in prerm during upgrades.
		invoke-rc.d haproxy reload || true
	fi
fi

exit 0