Launch systemd-tmpfiles once in read-only file-system

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Background



I'm setting up a Linux environment (Raspbian Stretch for RPi) writing a script that customize everything I need. Some commands are issued using systemd-nspawn.



The file-system is mount in read-only and when it runs on the target the systemd-tmpfiles-setup.service fails because it hasn't configured yet and of course it cannot create anything on the fs.



Question



How to properly setup up this service in such a scenario?



Some ideas



  1. execute systemd-nspawn -b on the host system in order to launch the service once and shutdown (could be done via script?)

  2. leave the system rw for the first boot, than execute a script that automatically setups the file-system in ro and reboots

I would prefer the first way (or a similar one) because I would like to end the deployment with the definitive SD-card image.










share|improve this question

























    up vote
    0
    down vote

    favorite












    Background



    I'm setting up a Linux environment (Raspbian Stretch for RPi) writing a script that customize everything I need. Some commands are issued using systemd-nspawn.



    The file-system is mount in read-only and when it runs on the target the systemd-tmpfiles-setup.service fails because it hasn't configured yet and of course it cannot create anything on the fs.



    Question



    How to properly setup up this service in such a scenario?



    Some ideas



    1. execute systemd-nspawn -b on the host system in order to launch the service once and shutdown (could be done via script?)

    2. leave the system rw for the first boot, than execute a script that automatically setups the file-system in ro and reboots

    I would prefer the first way (or a similar one) because I would like to end the deployment with the definitive SD-card image.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Background



      I'm setting up a Linux environment (Raspbian Stretch for RPi) writing a script that customize everything I need. Some commands are issued using systemd-nspawn.



      The file-system is mount in read-only and when it runs on the target the systemd-tmpfiles-setup.service fails because it hasn't configured yet and of course it cannot create anything on the fs.



      Question



      How to properly setup up this service in such a scenario?



      Some ideas



      1. execute systemd-nspawn -b on the host system in order to launch the service once and shutdown (could be done via script?)

      2. leave the system rw for the first boot, than execute a script that automatically setups the file-system in ro and reboots

      I would prefer the first way (or a similar one) because I would like to end the deployment with the definitive SD-card image.










      share|improve this question













      Background



      I'm setting up a Linux environment (Raspbian Stretch for RPi) writing a script that customize everything I need. Some commands are issued using systemd-nspawn.



      The file-system is mount in read-only and when it runs on the target the systemd-tmpfiles-setup.service fails because it hasn't configured yet and of course it cannot create anything on the fs.



      Question



      How to properly setup up this service in such a scenario?



      Some ideas



      1. execute systemd-nspawn -b on the host system in order to launch the service once and shutdown (could be done via script?)

      2. leave the system rw for the first boot, than execute a script that automatically setups the file-system in ro and reboots

      I would prefer the first way (or a similar one) because I would like to end the deployment with the definitive SD-card image.







      systemd raspberry-pi raspbian systemd-nspawn






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 25 '17 at 12:52









      Mark

      1339




      1339

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f394316%2flaunch-systemd-tmpfiles-once-in-read-only-file-system%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f394316%2flaunch-systemd-tmpfiles-once-in-read-only-file-system%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?