All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ref-manual: update  overlayfs class
@ 2021-11-01 11:58 Vyacheslav Yurkov
  2021-11-02  9:56 ` [docs] " Quentin Schulz
  0 siblings, 1 reply; 2+ messages in thread
From: Vyacheslav Yurkov @ 2021-11-01 11:58 UTC (permalink / raw)
  To: docs; +Cc: Vyacheslav Yurkov

Describe how to use a generated helper service to set up a proper
systemd dependency chain.

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
 documentation/ref-manual/classes.rst | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 9b1ead66b..1638f6ea0 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -1742,7 +1742,8 @@ Then you can specify writable directories on a recipe basis (e.g. in my-applicat
 
 To support several mount points you can use a different variable flag. Assuming we
 want to have a writable location on the file system, but do not need that the data
-survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a ``tmpfs`` file system.
+survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a ``tmpfs`` 
+file system.
 
 In your machine configuration::
 
@@ -1752,6 +1753,22 @@ and then in your recipe::
 
   OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application"
 
+On a practical note, your application recipe might use several mount points,
+therefore you'd like your application to start only when all overlays are mounted
+otherwise you might end up in a situation when application would write to an actual
+underlying file system (if it allows it) or could't write at all (for RO file systems).
+To achieve that :ref:`overlayfs <ref-classes-overlayfs>` provides another helper 
+service, which you can use to set dependencies on. The systemd dependency chain makes
+sure the service start only when all ``overlayfs`` mount points used in the recipe 
+are mounted. File name is fixed to ``${PN}-overlays.service``, so you can depend only 
+on this service in your application service file. E.g. if you have a recipe 
+``application.bb`` and a corresponding start-up service ``application.service``, you 
+can add dependencies as follows::
+
+  [Unit]
+  After=application-overlays.service
+  Requires=application-overlays.service
+
 .. note::
 
    The class does not support the ``/etc`` directory itself, because ``systemd`` depends on it.
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-02  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-01 11:58 [PATCH] ref-manual: update overlayfs class Vyacheslav Yurkov
2021-11-02  9:56 ` [docs] " Quentin Schulz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.