Merge ~smoser/cloud-init:bug/1636912-systemd-cleanup into cloud-init:master

Proposed by Scott Moser
Status: Merged
Merged at revision: bf4010a9c379e2109b030af558033014f9137f47
Proposed branch: ~smoser/cloud-init:bug/1636912-systemd-cleanup
Merge into: cloud-init:master
Diff against target: 44 lines (+4/-6)
2 files modified
systemd/cloud-init-local.service (+2/-2)
systemd/cloud-init.service (+2/-4)
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
cloud-init Commiters Pending
Review via email: mp+310547@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

LGTM, except for dropping local-fs.target; see inline comment.

review: Needs Information
Revision history for this message
Ryan Harper (raharper) wrote :

We should sync/link with a systemd but requiring systemd-networkd.service to drop After=dbus.service ... nto sure if https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1636912 covers that on the systemd side, without that, networkd/netplan enabled instances will break if they want to mount things early (like in Azure).

Revision history for this message
Martin Pitt (pitti) wrote :

LGTM now, thanks!

Yes, bug 163692 covers making networkd not wait for dbus.service. I'll get to that RSN.

review: Approve
Revision history for this message
Scott Moser (smoser) wrote :

Martin, i think you typoed the bug number above.

Revision history for this message
Martin Pitt (pitti) wrote :

I meant bug 1636912, the one Ryan already pointed to.

Revision history for this message
Scott Moser (smoser) wrote :

When re-reviewing this, I saw that cloud-init-local.service still has 'Before=basic.target'.
I'm wondering if Martin just missed that, or if that is ok.

see Martin's comment at https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1629797/comments/20 for why we made the change to cloud-init.service.

Revision history for this message
Scott Moser (smoser) wrote :

further reading and i realize that sysinit.target is before basic.target.

So, the 'Before=basic.target' in cloud-init-local.service is basically pointless as cloud-init.service has After=cloud-init.service and Before=sysinit.target.

Revision history for this message
Scott Moser (smoser) wrote :

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/systemd/cloud-init-local.service b/systemd/cloud-init-local.service
2index 55834ba..9b3e88f 100644
3--- a/systemd/cloud-init-local.service
4+++ b/systemd/cloud-init-local.service
5@@ -1,14 +1,14 @@
6 [Unit]
7 Description=Initial cloud-init job (pre-networking)
8 DefaultDependencies=no
9-Wants=local-fs.target
10 Wants=network-pre.target
11-After=local-fs.target
12+After=systemd-remount-fs.service
13 Before=basic.target
14 Before=NetworkManager.service
15 Before=network-pre.target
16 Before=shutdown.target
17 Conflicts=shutdown.target
18+RequiresMountsFor=/var/lib
19
20 [Service]
21 Type=oneshot
22diff --git a/systemd/cloud-init.service b/systemd/cloud-init.service
23index 5c71b21..cde6ed8 100644
24--- a/systemd/cloud-init.service
25+++ b/systemd/cloud-init.service
26@@ -2,17 +2,15 @@
27 Description=Initial cloud-init job (metadata service crawler)
28 DefaultDependencies=no
29 Wants=cloud-init-local.service
30-Wants=local-fs.target
31 Wants=sshd-keygen.service
32 Wants=sshd.service
33 After=cloud-init-local.service
34 After=networking.service
35-Requires=networking.service
36-Before=basic.target
37-Before=dbus.socket
38+After=systemd-networkd-wait-online.service
39 Before=network-online.target
40 Before=sshd-keygen.service
41 Before=sshd.service
42+Before=sysinit.target
43 Before=systemd-user-sessions.service
44 Conflicts=shutdown.target
45

Subscribers

People subscribed via source and target branches