From 1f5489c258a26f4e26261c40786537951d67df1e Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 8 Dec 2016 13:27:53 +0100 Subject: systemd: make systemd-fsck run after cloud-init.service cloud-init.service may write filesystems (fs_setup) or re-partition (disk_setup) disks. If systemd-fsck is running on a device while that is occuring then the partitioning or mkfs might fail due to the device being busy. Alternatively, the fsck might fail and cause subsequent mount to fail. LP: #1691489 --- setup.py | 4 ++++ systemd/systemd-fsck@.service.d/cloud-init.conf | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 systemd/systemd-fsck@.service.d/cloud-init.conf diff --git a/setup.py b/setup.py index 1197eceb..b1bde43b 100755 --- a/setup.py +++ b/setup.py @@ -125,6 +125,7 @@ INITSYS_FILES = { for f in (glob('systemd/*.tmpl') + glob('systemd/*.service') + glob('systemd/*.target')) if is_f(f)], + 'systemd.fsck-dropin': ['systemd/systemd-fsck@.service.d/cloud-init.conf'], 'systemd.generators': [f for f in glob('systemd/*-generator') if is_f(f)], 'upstart': [f for f in glob('upstart/*') if is_f(f)], } @@ -134,6 +135,9 @@ INITSYS_ROOTS = { 'sysvinit_deb': 'etc/init.d', 'sysvinit_openrc': 'etc/init.d', 'systemd': pkg_config_read('systemd', 'systemdsystemunitdir'), + 'systemd.fsck-dropin': ( + os.path.sep.join([pkg_config_read('systemd', 'systemdsystemunitdir'), + 'systemd-fsck@.service.d'])), 'systemd.generators': pkg_config_read('systemd', 'systemdsystemgeneratordir'), 'upstart': 'etc/init/', diff --git a/systemd/systemd-fsck@.service.d/cloud-init.conf b/systemd/systemd-fsck@.service.d/cloud-init.conf new file mode 100644 index 00000000..0bfa465b --- /dev/null +++ b/systemd/systemd-fsck@.service.d/cloud-init.conf @@ -0,0 +1,2 @@ +[Unit] +After=cloud-init.service -- cgit v1.2.3