<div dir="ltr">Each nspawn container that's managed via machinectl is run as an instance of "systemd-nspawn@.service". Add a [Service] ExecStartPre= to the instance you need, using `systemctl edit` or similar.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 2, 2023 at 1:37 AM Rob Ert <<a href="mailto:ertr3960@gmail.com">ertr3960@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:large"><div dir="ltr"><div class="gmail_default" style="font-size:large"><div class="gmail_default" style="font-size:large">Hello all,</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">As
I have not been able to find an answer to my question after consulting
man pages and google, I am turning to this mailing list.</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">I have a systemd-nspawn os container that I have set to automatically start with machinectl enable.</div><div class="gmail_default" style="font-size:large">I
would like to automatically have a bcachefs snapshot created before the
machine is started. As provisions for a hook to script something like
this do not seem to be supported in systemd.nspawn,</div><div class="gmail_default" style="font-size:large">I would like to know what and where the best way and place to achieve this is?<br></div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">Please cc me.</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">Many thanks,</div><div class="gmail_default" style="font-size:large">and all the best,</div><div class="gmail_default" style="font-size:large">Rob</div></div></div></div></div>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div>