MAAS does not detect properly if Ubuntu is using upstart/systemd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Won't Fix
|
Undecided
|
Unassigned | ||
1.9 |
In Progress
|
Critical
|
Unassigned | ||
maas (Ubuntu) |
Won't Fix
|
Critical
|
Unassigned | ||
Trusty |
Fix Released
|
Critical
|
Unassigned | ||
snapd (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned | ||
Trusty |
Invalid
|
Undecided
|
Unassigned | ||
systemd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Trusty |
Invalid
|
Critical
|
Unassigned |
Bug Description
[impact]
Since Trusty uses upstart by default, MAAS manages its services with upstart. However, when a user installs systemd (even if it is not used as the init system), MAAS detects systemd installed and tries to manage its services via systemd. This obviously creates issues and prevents MAAS from working.
[Test Case]
1. Install & configure MAAS
2. Add machines
3. install systemd
4. MAAS will fail to manage machines
[Regression potential]
Minimal. This just ensures that upstart is detected correctly even if systemd is installed (but not used).
[Original bug report]
Trusty uses upstart by default, and installing snapd (e.g. for livepatch purposes), pulls systemd too. In this setup, upstart is _not_ replaced by systemd, but MAAS "detects" systemd as init because of the existence of /run/systemd/
@src/provisioni
SYSTEMD_RUN_PATH = '/run/systemd/
def get_init_system():
"""Returns 'upstart' or 'systemd'."""
if os.path.
return 'systemd'
else:
return 'upstart'
One possible solution would be to check if /sbin/init is a symlink pointing to /lib/systemd/
def get_init_system():
"""Returns 'upstart' or 'systemd'."""
initpath = os.readlink(
if (initpath == "/lib/systemd/
return 'systemd'
else:
return 'upstart'
Other affected parts of the code are the postinst files for maas-proxy and maas-dhcp (debian/
Related branches
- Mike Pontillo (community): Approve
- MAAS Lander: Needs Fixing
-
Diff: 22 lines (+5/-7)1 file modifiedsrc/provisioningserver/utils/__init__.py (+5/-7)
Changed in maas: | |
status: | New → Incomplete |
status: | Incomplete → Won't Fix |
description: | updated |
Changed in maas (Ubuntu): | |
importance: | Undecided → Critical |
Changed in systemd (Ubuntu Trusty): | |
importance: | Undecided → Critical |
Changed in maas (Ubuntu): | |
status: | New → Won't Fix |
Changed in maas (Ubuntu Trusty): | |
status: | New → Triaged |
importance: | Undecided → Critical |
tags: |
added: verification-done verification-done-trusty removed: verification-needed verification-needed-trusty |
Changed in systemd (Ubuntu Trusty): | |
status: | Confirmed → Invalid |
Changed in systemd (Ubuntu): | |
status: | Confirmed → Invalid |
Hi Victor,
Can you clarify what issues you are having? It is not clear from the bug the issues you are having.
That said, MAAS was never enabled to work on a system with both systemd + upstart, where upstart would remain the init system. Ubuntu, at the time, was not even fully prepared to use systemd. This is a grey area where it is difficult to fix something that is not supported, with a high regression potential.