postinst is in maas-region-api 2.0.0~beta3+bzr4941-0ubuntu1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | #!/bin/sh
set -e
. /usr/share/debconf/confmodule
db_version 2.0
RELEASE=`lsb_release -rs` || RELEASE=""
configure_region_http() {
# handle apache configs
if [ -e /usr/share/maas/maas-http.conf -a \
! -e /etc/apache2/conf-enabled/maas-http.conf ]; then
ln -sf /usr/share/maas/maas-http.conf /etc/apache2/conf-enabled/maas-http.conf
fi
# enable apache modules needed
a2enmod proxy_http
a2enmod proxy_wstunnel
a2enmod expires
a2enmod rewrite
}
configure_logging() {
# Give appropriate permissions
if [ ! -f /var/log/maas/regiond.log ]; then
touch /var/log/maas/regiond.log
fi
chown maas:maas /var/log/maas/regiond.log
# Create log directory base
mkdir -p /var/log/maas/rsyslog
chown -R syslog:syslog /var/log/maas/rsyslog
# Make sure rsyslog reads our config
invoke-rc.d rsyslog restart
# apache2 log symlinks
ln -sf /var/log/apache2 /var/log/maas/
}
configure_libdir() {
# If /var/lib/maas/secret exists, ensure ownership and
# permissions are correct
if [ -f /var/lib/maas/secret ]; then
chown maas:maas /var/lib/maas/secret
chmod 0640 /var/lib/maas/secret
fi
if [ -f /var/lib/maas/maas_id ]; then
chown maas:maas /var/lib/maas/maas_id
fi
}
# Unconditionally ensure that there is at least an empty configuration
# file. This does *not* overwrite any existing configuration.
maas-region local_config_set
if [ "$1" = "configure" ] && [ -z "$2" ]; then
configure_region_http
configure_logging
configure_libdir
elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
# Logging changed at r2611, ensure it is set up.
configure_logging
configure_libdir
# If upgrading to any later package version, then upgrade db.
invoke-rc.d apache2 stop || true
# make sure maas http config is symlinked
configure_region_http
fi
invoke-rc.d apache2 restart || true
db_stop
# Automatically added by dhpython:
if which py3compile >/dev/null 2>&1; then
py3compile -p maas-region-api -V 3.5-
fi
# End automatically added section
# Automatically added by dh_systemd_enable
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask maas-regiond.service >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled maas-regiond.service; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable maas-regiond.service >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state maas-regiond.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
if [ -x "/etc/init.d/maas-regiond" ]; then
update-rc.d maas-regiond defaults >/dev/null || exit $?
fi
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
if [ -x "/etc/init.d/maas-regiond-worker@" ]; then
update-rc.d maas-regiond-worker@ defaults >/dev/null || exit $?
fi
fi
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/maas/txlongpoll.yaml 1.7.0~beta4+bzr3124-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/init/maas-txlongpoll.conf 1.7.0~beta4+bzr3124-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/init/maas-region-celery.conf 1.7.0~beta4+bzr3124-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/maas/maas_local_celerconfig.py 1.7.0~beta4+bzr3124-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /usr/share/maas/maas_local_celerconfig.py 1.7.0~beta4+bzr3124-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/maas/maas_local_celeryconfig.py 1.7.0~beta4+bzr3124-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/maas/maas-http.conf 1.9.0~alpha1+bzr4190-0ubuntu1 -- "$@"
# End automatically added section
|