postinst is in maas-region-api 2.4.0~beta2-6865-gec43e47e6-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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | #!/bin/sh
set -e
. /usr/share/debconf/confmodule
db_version 2.0
RELEASE=`lsb_release -rs` || RELEASE=""
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 after creating the
# destination folder.
systemctl restart rsyslog >/dev/null 2>&1 || true
}
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
}
edit_named_options() {
# Remove any existing MAAS-related include line from
# /etc/bind/named.conf.local, then re-add it.
sed -i '/^include\s.*maas/d' /etc/bind/named.conf.local
maas-region get_named_conf --edit --config_path /etc/bind/named.conf.local
# Add a line in /etc/bind/named.conf.options that includes the
# /etc/named/maas/named.conf.options.inside.maas file.
maas-region edit_named_options --config-path /etc/bind/named.conf.options
}
fix_dns_permissions() {
if [ -d /etc/bind/maas ]; then
chown maas:root /etc/bind/maas
chown -R maas:maas /etc/bind/maas/*
fi
if [ -f /etc/bind/maas/named.conf.maas ]; then
chown maas:maas /etc/bind/maas/named.conf.maas
chmod 644 /etc/bind/maas/named.conf.maas
fi
if [ -f /etc/bind/maas/named.conf.options.inside.maas ]; then
chown maas:maas /etc/bind/maas/named.conf.options.inside.maas
chmod 644 /etc/bind/maas/named.conf.options.inside.maas
fi
if [ -f /etc/bind/maas/rndc.conf.maas ]; then
chown maas:root /etc/bind/maas/rndc.conf.maas
chmod 600 /etc/bind/maas/rndc.conf.maas
fi
if [ -f /etc/bind/maas/named.conf.rndc.maas ]; then
chown maas:bind /etc/bind/maas/named.conf.rndc.maas
chmod 640 /etc/bind/maas/named.conf.rndc.maas
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_logging
configure_libdir
# Configure DNS
# If /etc/bind/maas is empty, set_up_dns.
if [ ! "$(ls -A /etc/bind/maas)" ]; then
maas-region set_up_dns
fi
fix_dns_permissions
edit_named_options
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
# Configure DNS
fix_dns_permissions
edit_named_options
fi
invoke-rc.d bind9 restart || true
db_stop
# Automatically added by dh_systemd_enable/11.1.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# 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
fi
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/maas/txlongpoll.yaml 1.7.0~beta4+bzr3124-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
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/11.1.6ubuntu1
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/11.1.6ubuntu1
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/11.1.6ubuntu1
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/11.1.6ubuntu1
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/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/maas/maas-http.conf 1.9.0~alpha1+bzr4190-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /lib/systemd/system/maas-regiond-worker@.service 2.4.0~alpha1-6555-g2acf28404-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /lib/systemd/system/maas-regiond.service.wants/maas-regiond-worker@1.service 2.4.0~alpha1-6555-g2acf28404-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /lib/systemd/system/maas-regiond.service.wants/maas-regiond-worker@2.service 2.4.0~alpha1-6555-g2acf28404-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /lib/systemd/system/maas-regiond.service.wants/maas-regiond-worker@3.service 2.4.0~alpha1-6555-g2acf28404-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /lib/systemd/system/maas-regiond.service.wants/maas-regiond-worker@4.service 2.4.0~alpha1-6555-g2acf28404-0ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_installinit/11.1.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -x "/etc/init.d/maas-regiond" ]; then
update-rc.d maas-regiond defaults >/dev/null || exit 1
fi
fi
# End automatically added section
|