Custom script on live USB

Forum Forums General Software Custom script on live USB

  • This topic has 5 replies, 3 voices, and was last updated Aug 21-12:37 am by Minam.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26023
    Member
    Minam

      Hello,

      Here is my question : how do you run a custom script at boot on an AntiX live USB.

      I tried a very simple script on /home/dev/demo. I changed the permission to chmod 777 and it’s runing great.
      I put a line in /etc/rc.local to launch that script. From the terminal, I can run the rc.local from the terminal which is also launching my custom script.

      However, at boot, the rc.local reset to the default file so my custom script can’t be launch.
      Even with a persistant root live USB, the rc.local resets.

      Any idea to solve my problem ?
      How to launch a custom script from an AntiX live USB ?

      Thanks,

      Minam

      #26037
      Forum Admin
      anticapitalista
        Helpful
        Up
        0
        ::

        Does it work as you have it now with a persistent homefs?

        Philosophers have interpreted the world in many ways; the point is to change it.

        antiX with runit - leaner and meaner.

        #26039
        Member
        Minam
          Helpful
          Up
          0
          ::

          No it doesn’t work with persistant root. The rc.local reset everyboot so I can not launch my custom script.
          I choose persistant root manual save. I didn’t understand that part very well. but other files in /home/demo/Documents can be saved between boots.

          #26042
          Forum Admin
          anticapitalista
            Helpful
            Up
            0
            ::

            persistent home not root.

            Philosophers have interpreted the world in many ways; the point is to change it.

            antiX with runit - leaner and meaner.

            #26068
            Member
            rayluo
              Helpful
              Up
              0
              ::

              No it doesn’t work with persistant root. The rc.local reset everyboot so I can not launch my custom script.
              I choose persistant root manual save. I didn’t understand that part very well.

              You need to follow anticapitalista’s suggestion. Using persistent **home** would do it.

              but other files in /home/demo/Documents can be saved between boots.

              If you were not using Persistent Home, “/home/demo/Documents” aren’t supposed to be saved between boots.
              Perhaps you were referring to documents inside “/home/demo/Live-usb-storage”? Those would be saved regardless of what persistence you would use, if at all.

              Lastly, since you are also new here (#HandShake), this might also be a good FYI to you. https://www.antixforum.com/forums/topic/why-setting-up-home-persistence-not-force-me-to-create-a-different-password/

              #26071
              Member
              Minam
                Helpful
                Up
                0
                ::

                Hello,

                Thank you for your help. Yes I messed up between persistent all/home/root.
                So I have two requirements :
                1/ my custom script in /home/demo/Docments/test.sh must be saved between boots
                2/ /etc/rc.local must not be reseted between boots (to launch my custom script on boot with the last line : “sh /home/demo/Document/test.sh”

                Here are my tests :

                A/ custom script /home/demo/Documents/test.sh, rc.local modified and persistent root
                => NOK : custom file erased after boot (…/Documents/ is empty) and rc.local is reseted after boot (my last line to launch the custom script is not here anymore)

                B/ custom script /home/demo/Documents/test.sh, rc.local modified and persistent all
                => NOK : custom file OK (…/Documents/test.sh is still here) and rc.local is reseted after boot (my last line to launch the custom script is not here anymore)

                C/ custom script /home/demo/Documents/test.sh, rc.local modified and persistent home
                => NOK : custom file OK (…/Documents/test.sh is still here) and rc.local is reseted after boot (my last line to launch the custom script is not here anymore)

                Even with persistent home, I can’t launch my custom script at boot. The problem is the rc.local that I can’t modify.

                Minam

                • This reply was modified 3 years, 8 months ago by Minam.
              Viewing 6 posts - 1 through 6 (of 6 total)
              • You must be logged in to reply to this topic.