From 11121fe4d5af0554140d88685029fa248fa0c7c9 Mon Sep 17 00:00:00 2001
From: Scott Moser <smoser@brickies.net>
Date: Mon, 12 Jun 2017 14:10:58 -0400
Subject: systemd: make cloud-final.service run before apt daily services.

This changes all cloud-init systemd units to run 'Before' the apt processes
that run daily and may cause a lock on the apt database.

apt-daily-upgrade.service contains 'After=apt-daily.service'.
Thus following order is enforced, so we can just be 'Before' the first.
   apt-daily.service
   apt-daily-upgrade.service

Note that this means only that apt-daily* will not run until
cloud-init has entirely finished. Any other processes running apt-get
operations are still affected by the global lock.

LP: #1693361
---
 systemd/cloud-final.service | 1 +
 1 file changed, 1 insertion(+)

(limited to 'systemd')

diff --git a/systemd/cloud-final.service b/systemd/cloud-final.service
index b8f69b78..66f5b8fc 100644
--- a/systemd/cloud-final.service
+++ b/systemd/cloud-final.service
@@ -2,6 +2,7 @@
 Description=Execute cloud user/final scripts
 After=network-online.target cloud-config.service rc-local.service multi-user.target
 Wants=network-online.target cloud-config.service
+Before=apt-daily.service
 
 [Service]
 Type=oneshot
-- 
cgit v1.2.3