[0-day sru] maas needs to support systemd for Ubuntu >= 15.04

Bug #1423613 reported by Martin Pitt on 2015-02-19
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Andres Rodriguez
maas (Ubuntu)
Andres Rodriguez

Bug Description

WIthout systemd support MAAS wont be able to work in Vivid.

[Test Case]
1. Install MAAS
2. Check that services are running (maas-clusterd, apache2).
3. Access MAAS at http://localhost/MAAS

[Regression Potential]
Minimal. This has been tested in production environments.

As discussed in https://blueprints.launchpad.net/ubuntu/+spec/core-1411-systemd-migration, Ubuntu is currently being converted from upstart to systemd. maas ships three upstart jobs, but doesn't ship corresponding sysvinit scripts or systemd units.

https://wiki.ubuntu.com/SystemdForUpstartUsers describes how to port these.

vivid main package net/maas-cluster-controller requires systemd migration (sysv=False, upstart=True, systemd=False)
vivid main package net/maas-dhcp requires systemd migration (sysv=False, upstart=True, systemd=False)
vivid main package net/maas-proxy requires systemd migration (sysv=False, upstart=True, systemd=False)

Sorry for reporting this so late, so far this was only discussed in hangout meetings.

Related branches

Steve Langasek (vorlon) on 2015-02-19
Changed in maas (Ubuntu):
importance: Undecided → Critical
Martin Pitt (pitti) wrote :

As for maas-dhcpd[6].conf: These look almost exactly like the jobs from isc-dhcp. These got converted in http://launchpadlibrarian.net/194979593/isc-dhcp_4.3.1-5ubuntu1_4.3.1-5ubuntu2.diff.gz, so that can be applied to MAAS' jobs too.

Martin Pitt (pitti) wrote :

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


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:


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


And a similar unit for -squid3.service.

Steve Langasek (vorlon) wrote :

Marking this bug as critical, because it's one of two last blockers for the switch to systemd by default in 15.04, and feature freeze is upon us. If we don't resolve this, we will need to leave maas broken in vivid temporarily with systemd as default.

Steve Langasek (vorlon) wrote :

I believe there had been discussion during the systemd sprint about having maas set a boot option to continue booting upstart until the systemd units have been written, so that this could be removed from the critical path. But I don't see that this was captured anywhere.

Martin Pitt (pitti) wrote :

This is a first (untested) approach to maas-clusterd.service.

This doesn't do the ExecStartPre= with the "A shared secret has not been installed for this cluster...." bits, as that's quite ugly -- you don't see this anywhere if you aren't on a console of the machine, and eventually it will time out and not restart automatically any more. This job will start if a secret exists, and just silently not start if there isn't one (and show you that the condition for the secret is failing, in systemctl status maas-clusterd).

This can be modelled with two jobs, one which waits for a secret to appear, which then starts maas-clusterd.service. But before I write such a thing, I'd be interested in the precise semantics of this. I. e. what creates the secret? Does that happen automatically, or does the user have to do that manually? How long should we wait for it?

Blake Rouse (blake-rouse) wrote :

Changes also need to be made to the MAAS code that start and stop services. The code needs to be modified to support both upstart and systemd.

Changing the code from:

service maas-dhcpd restart


restart maas-dhcpd

should allow it to work for both upstart and systemd.

Changed in maas:
status: New → Triaged
importance: Undecided → Critical
milestone: none → next
Changed in maas (Ubuntu):
status: New → Confirmed
Martin Pitt (pitti) wrote :

@Blake: It should be exactly the other way around: "restart foo" is upstart specific, "service foo restart" works with systemd, upstart, sysv, and any other init system. I figure it was just a typo, but let's better be clear here :-)

Blake Rouse (blake-rouse) wrote :


It was not a typo, looks as if I was incorrect. Then the MAAS code needs to be checked to make sure only "service foo restart" is being used. I believe this is the case, so the code might not have to be adjusted.

Changed in maas:
assignee: nobody → Mike Pontillo (mpontillo)
Changed in maas:
assignee: Mike Pontillo (mpontillo) → Andres Rodriguez (andreserl)
Changed in maas:
status: Triaged → In Progress
Sean Feole (sfeole) on 2015-03-17
tags: added: hs-arm64
Changed in maas:
status: In Progress → Fix Committed
Martin Pitt (pitti) on 2015-03-30
Changed in maas (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Andres Rodriguez (andreserl)
summary: - maas needs to support systemd for Ubuntu >= 15.04
+ [0-day sru] maas needs to support systemd for Ubuntu >= 15.04
description: updated

Hello Martin, or anyone else affected,

Accepted maas into vivid-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/maas/1.7.3+bzr3363-0ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Andres Rodriguez (andreserl) wrote :

I have tested this and it works as expected!

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package maas - 1.7.3+bzr3363-0ubuntu2

maas (1.7.3+bzr3363-0ubuntu2) vivid; urgency=medium

  * Use python-django16 instead of python-django ( 1.7). MAAS does not
    support django 1.7 due to having a new migration system. (LP: #1447573)
  * Adding systemd units and packaging support. (LP: #1423613)
  * debian/control: Add missing dependency on python-apt. (LP: #1446878)
 -- Andres Rodriguez <email address hidden> Wed, 22 Apr 2015 12:10:50 -0400

Changed in maas (Ubuntu):
status: In Progress → Fix Released

The verification of the Stable Release Update for maas has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Changed in maas:
milestone: next → none
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers