diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-12-08 13:27:53 +0100 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-07-25 15:41:23 -0400 |
commit | 1f5489c258a26f4e26261c40786537951d67df1e (patch) | |
tree | 891a5a329375dfa920b000a7e33d242d4edeb637 | |
parent | ebdbf30c0274f078f7a66f6dc9efc8a22a220757 (diff) | |
download | vyos-cloud-init-1f5489c258a26f4e26261c40786537951d67df1e.tar.gz vyos-cloud-init-1f5489c258a26f4e26261c40786537951d67df1e.zip |
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
-rwxr-xr-x | setup.py | 4 | ||||
-rw-r--r-- | systemd/systemd-fsck@.service.d/cloud-init.conf | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -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 |