<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal">We would like to have a ROFS volume on which the whole fs is and writeable config volume on which with have the same /etc.<o:p></o:p></p>
<p class="MsoNormal">Current kernel is 5.11<o:p></o:p></p>
<p class="MsoNormal">I have done an /etc/ overlay using the service var-volatile-etc for the RO FS. And then added another service to either mount the config /etc on top of the /etc overlay when the config volume is rw or mount the config volume to a temp
directory and then overlay it to the /etc/ overlay when the volume is RO.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">It seems to be working as I am able to disable our services (bit, sensor) on config volume and they don’t start.<o:p></o:p></p>
<p class="MsoNormal">Also the OOB address is assigned from the configuration file.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Then I found <a href="https://lists.freedesktop.org/archives/systemd-devel/2019-February/042151.html">
https://lists.freedesktop.org/archives/systemd-devel/2019-February/042151.html</a> further below in quote:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-GB">So is it my understanding that as long as the mount or overlay happen early enough which is around the service for var-volatile-etc then there is a rescan and all config from the /etc
in the volume will be used then?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-GB">Following the thread, I also saw that it is advised to use initramfs. I am not clear why that makes a difference. This thread being 2 year old there may thing I am not aware of.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-GB">Cheers.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">“><i> I have an embedded system with a readonly rootfs.<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">><i>
<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">><i> I've setup a very early service that mounts a writable aufs overlay over /etc/.<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">><i>
<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">><i>
<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">><i> The problem I'm having is systemd is not starting any services that I have enabled in that overlay that were not initially enabled in the
readonly rootfs.<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">><i>
<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">><i> ?I've tried placing a calls to systemctl daemon-reload or systemctl daemon-reexec just after mounting the overlay but the services are
not started, after the fact systemctl will report that the services are enabled but inactive.<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">><i>
<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">If you are doing it as part of normal startup, then systemd has already<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">computed initial "transaction". While daemon-reload makes it rescan for<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">and see additional unit definitions, it does not change currently<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">running "transaction".”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB">Renaud<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>