ubuntu-snappy.run-hooks.service causes circular dependency

Bug #1440978 reported by Martin Pitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Critical
Michael Vogt

Bug Description

ubuntu-snappy.run-hooks.service has DefaultDependencies, i. e. implicitly runs in late boot with After=sysinit.target, but declares Before=apparmor.service which needs to run during very early boot. This can't work and breaks random other services:

Apr 07 05:49:18 localhost.localdomain systemd[1]: Found ordering cycle on sysinit.target/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on networking.service/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on apparmor.service/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on ubuntu-snappy.run-hooks.service/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on basic.target/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on sockets.target/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on dbus.socket/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on sysinit.target/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Breaking ordering cycle by deleting job networking.service/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Job networking.service/start deleted to break ordering cycle starting with sysinit.target/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found ordering cycle on sysinit.target/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on apparmor.service/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on ubuntu-snappy.run-hooks.service/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on basic.target/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on sockets.target/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on dbus.socket/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Found dependency on sysinit.target/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Breaking ordering cycle by deleting job apparmor.service/start
Apr 07 05:49:18 localhost.localdomain systemd[1]: Job apparmor.service/start deleted to break ordering cycle starting with sysinit.target/start

Related branches

Martin Pitt (pitti)
Changed in snappy-ubuntu:
importance: Undecided → Critical
status: New → In Progress
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

This comes from http://bazaar.launchpad.net/~snappy-dev/snappy/snappy/revision/303.

I need some information about this first. Michael, does this really need to run before apparmor.service, i. e. does this do any setup of apparmor rules? If so, pretty much the only assumption that this could make is local-fs.target, nothing else (in particular, no networking and similar). In that case, DefaultDependencies=no and After=local-fs.target would be correct.

Changed in snappy-ubuntu:
assignee: Martin Pitt (pitti) → Michael Vogt (mvo)
status: In Progress → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

From my cursory inspection of the code this rather sounds like it should run the click system hooks. This is all late-boot, isn't it? I. e. the Before=apparmor.service actually ought to be After=apparmor.service, and can be dropped completely as it's implied by the default dependencies?

Michael Vogt (mvo)
Changed in snappy-ubuntu:
status: Triaged → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Discussed on IRC, and we settled for http://paste.ubuntu.com/10758903/

Michael Vogt (mvo)
Changed in snappy-ubuntu:
status: In Progress → Fix Released
Michael Terry (mterry)
affects: snappy-ubuntu → snappy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.