Message ID | 20250118-overlayfs-requires-v1-1-8f3eafdb54d0@geanix.com |
---|---|
State | New |
Headers | show |
Series | files: overlayfs-create-dirs: Improve mount unit dependency | expand |
diff --git a/meta/files/overlayfs-create-dirs.service.in b/meta/files/overlayfs-create-dirs.service.in index d8d916365a4562dbe522eca9f291a9a4c859f7d9..c8431548d76d18b8dfafd5a69d18f25b6629cc4f 100644 --- a/meta/files/overlayfs-create-dirs.service.in +++ b/meta/files/overlayfs-create-dirs.service.in @@ -1,7 +1,6 @@ [Unit] Description=Overlayfs directories setup {LOWERDIR} -Requires={DATA_MOUNT_UNIT} -After={DATA_MOUNT_UNIT} +RequiresMountsFor={DATA_MOUNT_POINT} DefaultDependencies=no [Service]
The RequiresMountsFor configuration option of systemd.unit (added in systemd version 201) not only adds the Requires and After options for the required mount unit, but it adds them for all mount units required to access the specified path. So this change is both a simplification, and an improvement. Not only will all needed mount units be added to Requires and After, but the overlay path does not have to be a mountpoint, but can be at any directory level beneath a mountpoint. Signed-off-by: Esben Haabendal <esben@geanix.com> --- meta/files/overlayfs-create-dirs.service.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- base-commit: f642edb006a8c16dbe45681afe547eabfae17073 change-id: 20250118-overlayfs-requires-cc24981f679b Best regards,