[Bug 1732703] Re: MAAS does not detect properly if Ubuntu is using upstart/systemd

Ivan Hitos 1732703 at bugs.launchpad.net
Tue Jan 16 12:33:43 UTC 2018


# VERIFICATION FOR TRUSTY

- Packages
-----------------------------------
# dpkg -l|grep maas
ii  maas                               1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS server all-in-one metapackage
ii  maas-cli                           1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS command line API tool
ii  maas-cluster-controller            1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS server cluster controller
ii  maas-common                        1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS server common files
ii  maas-dhcp                          1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS DHCP server
ii  maas-dns                           1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS DNS server
ii  maas-proxy                         1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS Caching Proxy
ii  maas-region-controller             1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS server complete region controller
ii  maas-region-controller-min         1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS Server minimum region controller
ii  python-django-maas                 1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS server Django web framework
ii  python-maas-client                 1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS python API client
ii  python-maas-provisioningserver     1.9.5+bzr4599-0ubuntu1~14.04.3   all          MAAS server provisioning libraries
 
 
- Tests
-----------------------------------
Update maas from proposed. Add to /etc/apt/sources.list:
deb [arch=amd64] http://archive.ubuntu.com/ubuntu trusty-proposed multiverse restricted main universe
deb-src [arch=amd64] http://archive.ubuntu.com/ubuntu trusty-proposed multiverse restricted main universe

- DNS+DHCP do work as expected (monitor does not ask systemd)
- Try enlisting -> works
- Try commissioning -> works
- Try deployment -> works
- Try deleting -> works
- Verified that both upgrade and install works:
# apt update + upgrade
# apt install maas

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1732703

Title:
  MAAS does not detect properly if Ubuntu is using upstart/systemd

Status in MAAS:
  Won't Fix
Status in MAAS 1.9 series:
  In Progress
Status in maas package in Ubuntu:
  Won't Fix
Status in snapd package in Ubuntu:
  Won't Fix
Status in systemd package in Ubuntu:
  New
Status in maas source package in Trusty:
  Fix Committed
Status in snapd source package in Trusty:
  Invalid
Status in systemd source package in Trusty:
  New

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/system:

  @src/provisioningserver/utils/__init__.py:505

  SYSTEMD_RUN_PATH = '/run/systemd/system'

  def get_init_system():
      """Returns 'upstart' or 'systemd'."""
      if os.path.exists(SYSTEMD_RUN_PATH):
          return 'systemd'
      else:
          return 'upstart'

  One possible solution would be to check if /sbin/init is a symlink
  pointing to /lib/systemd/systemd:

  def get_init_system():
      """Returns 'upstart' or 'systemd'."""
      initpath = os.readlink("/sbin/init")
      if (initpath == "/lib/systemd/systemd"):
          return 'systemd'
      else:
      return 'upstart'

  Other affected parts of the code are the postinst files for maas-proxy
  and maas-dhcp (debian/maas-proxy.postinst debian/maas-dhcp.postinst),
  throwing an error if maas is installed after systemd in Trusty

To manage notifications about this bug go to:
https://bugs.launchpad.net/maas/+bug/1732703/+subscriptions



More information about the foundations-bugs mailing list