~lamont/maas/bug-1568847

« back to all changes in this revision

Viewing changes to debian/maas-proxy.postinst

  • Committer: MAAS Lander
  • Author(s): LaMont Jones
  • Date: 2016-04-01 20:06:29 UTC
  • mfrom: (470.2.4 packaging.maas-proxy)
  • Revision ID: maas_lander-20160401200629-h2e6w15hrgygtlat
[r=andreserl][bug=1379567][author=lamont] Packaging changes for maas-proxy lockdown.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
if [ "$1" = "configure" ]
6
6
then
7
 
    # Stop the squid3 instance that came with the isc-dhcp-server package.
 
7
    # Stop the squid3 instance that came with the squid3 package.
8
8
    # We run our own squid3 instances.
9
 
    systemctl stop squid3 >/dev/null || true
10
 
    systemctl disable squid3 >/dev/null || true
 
9
    # Handle both versions of the name, for safety.
 
10
    for SQUID in squid squid3; do
 
11
        systemctl stop ${SQUID} >/dev/null 2>&1 || true
 
12
        systemctl disable ${SQUID} >/dev/null 2>&1 || true
 
13
    done
11
14
 
12
15
    # Ensure log folder is created.
13
16
    mkdir -p /var/log/maas/proxy
14
17
    chown -R proxy:proxy /var/log/maas/proxy
15
18
 
16
 
    # Move maas-proxy.conf if we are upgrading from an earlier
17
 
    # version that used to ship maas-proxy.conf in /etc/maas.
 
19
    # maas-proxy.conf is now generated by MAAS itself and if we are
 
20
    # upgrading from an earlier  version that used to ship maas-proxy.conf
 
21
    # in /etc/maas, it is safe to remove
18
22
    if [ -f /etc/maas/maas-proxy.conf ]; then
19
 
        mv /etc/maas/maas-proxy.conf /usr/share/maas/
 
23
        rm /etc/maas/maas-proxy.conf
20
24
    fi
21
25
 
22
26
fi