Debian Codegraph @

debian/postinst

raw
1 #!/bin/sh
2
3 set -e
4
5 # summary of how this script can be called:
6 # * <postinst> `configure' <most-recently-configured-version>
7 # * <old-postinst> `abort-upgrade' <new version>
8 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
9 # <new-version>
10 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
11 # <failed-install-package> <version> `removing'
12 # <conflicting-package> <version>
13 # for details, see http://www.debian.org/doc/debian-policy/ or
14 # the debian-policy package
15 #
16 # quoting from the policy:
17 # Any necessary prompting should almost always be confined to the
18 # post-installation script, and should be protected with a conditional
19 # so that unnecessary prompting doesn't happen if a package's
20 # installation fails and the `postinst' is called with `abort-upgrade',
21 # `abort-remove' or `abort-deconfigure'.
22
23 case "$1" in
24 configure)
25 # Add mtail user
26 if ! getent passwd mtail > /dev/null; then
27 adduser --quiet --system --home /nonexistent --no-create-home \
28 --group --gecos "mtail daemon" mtail || true
29 fi
30 # Add mtail user to the adm group on fresh installs
31 if [ -z "$2" ]; then
32 if getent group adm >/dev/null; then
33 adduser --quiet mtail adm
34 fi
35 fi
36 chown mtail:mtail /var/log/mtail || true
37 ;;
38
39 abort-upgrade|abort-remove|abort-deconfigure)
40 :
41 ;;
42
43 *)
44 echo "postinst called with unknown argument \`$1'" >&2
45 exit 1
46 ;;
47 esac
48
49 # dh_installdeb will replace this with shell code automatically
50 # generated by other debhelper scripts.
51
52 #DEBHELPER#
53
54 exit 0