Comment 2 for bug 1423613

Revision history for this message
Martin Pitt (pitti) wrote : Re: maas needs to support systemd for Ubuntu >= 15.04

As for the two .override files: Call "systemctl disable isc-dhcp-server isc-dhcp-server6" in the postinst; presumably you want to disable the IPv6 one as well (that's something that the current maas-cluster-controller doesn't do, it doesn't ship an upstart .override for that). Same for squid3.

As for maas-proxy.conf: "start on (local-filesystems and net-device-up IFACE!=lo)" translates to

  Requires=network-online.target
  After=network-online.target

if you don't want to start it if there's no interface. "stop on" doesn't need to be translated, and the pre-start and start scripts can be taken literally into

  ExecStartPre=/bin/sh -ec ' ...' lines like in the above isc-dhcp script (note that you need to use \ for multiple lines). To make this a bit more elegant and avoid the shell, you could split this into two units maas-proxy-squid.service and maas-proxy-squid3.service:

[Unit]
Description=...
Requires=network-online.target
After=network-online.target
ConditionFileIsExecutable=/usr/sbin/squid

[Service]
ExecStarPre=/bin/sh -ec '. /usr/share/maas/maas-proxy-common.sh; pre_start'
ExecStart=/usr/sbin/squid -N -f /etc/maas/maas-proxy.conf

[Install]
WantedBy=multi-user.target

And a similar unit for -squid3.service.