[Unit]
Description=Bind mount volatile /var/cache
DefaultDependencies=no
Before=local-fs.target
RequiresMountsFor=/var/volatile /var
ConditionPathIsReadWrite=|/var/volatile
ConditionPathExists=|!/var/volatile
ConditionPathExists=/var/cache
ConditionPathIsReadWrite=!/var/cache

[Service]
Type=oneshot
RemainAfterExit=Yes
Environment=MOUNT_COPYBIND_AVOID_OVERLAYFS=0
ExecStart=/sbin/mount-copybind /var/volatile/cache /var/cache
ExecStop=/bin/umount /var/cache

[Install]
WantedBy=local-fs.target
