Content of script in /etc/init.d/ deleted on restart/etc/init.d/script, or /etc/inittab - respawn on dieHow...

Demod as a neologism

I run daily 5kms but I cant seem to improve stamina when playing soccer

Interaction between casting spells and the Attack action

Is is possible to externally power my DSLR with the original battery that is connected to the DSLR by means of wires?

Can we not simply connect a battery to a RAM to prevent data loss during power cuts?

Where is the circle of fifths mentioned for the first time?

How will the crew exit Starship when it lands on Mars?

How does Data know about his off switch?

Code Golf Measurer © 2019

Vergil Book XII, Line 756 | Meter Question

Does obfuscation give any measurable security benefit?

Does Darwin owe a debt to Hegel?

What are the branches of statistics?

Is the tap water in France safe to drink?

Does the US require a House vote to begin an impeachment inquiry?

Are there 99 percentiles, or 100 percentiles? And are they groups of numbers, or dividers or pointers to individual numbers?

Idiom for a situation or event that makes one poor or even poorer?

How to figure out key from key signature?

How (and if) to include name change for transgender person in genealogy?

Does any politician honestly want a No Deal Brexit?

Digit Date Range

I am often given, occasionally stolen, rarely sold, and never borrowed

Should I avoid "big words" when writing to a younger audience?

Trade a bishop in the opening



Content of script in /etc/init.d/ deleted on restart


/etc/init.d/script, or /etc/inittab - respawn on dieHow to restore the /etc/init.d/pure-ftpd-mysql?Minimal Linux with kernel and BusyBox: /etc/inittab is ignored, only /init is executedHow does systemd use /etc/init.d scripts?Is /etc/init.d hard-linked on CentOS?How to write access to default /etc/init.dPorting init.d script to systemdWhither /etc/init.d/skeleton?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}








0

















I created a script in /etc/init.d called hello that does some bash commands. Sometimes when I restart the linux device (remove then reinstate power), the contents of my script get totally erased although the actual file is still there. There is another script in there called nginx that came with the system and doesn't have this problem.



I am running a Emlid RTK gps that has a linux computer built in.










share|improve this question


































    0

















    I created a script in /etc/init.d called hello that does some bash commands. Sometimes when I restart the linux device (remove then reinstate power), the contents of my script get totally erased although the actual file is still there. There is another script in there called nginx that came with the system and doesn't have this problem.



    I am running a Emlid RTK gps that has a linux computer built in.










    share|improve this question






























      0












      0








      0








      I created a script in /etc/init.d called hello that does some bash commands. Sometimes when I restart the linux device (remove then reinstate power), the contents of my script get totally erased although the actual file is still there. There is another script in there called nginx that came with the system and doesn't have this problem.



      I am running a Emlid RTK gps that has a linux computer built in.










      share|improve this question















      I created a script in /etc/init.d called hello that does some bash commands. Sometimes when I restart the linux device (remove then reinstate power), the contents of my script get totally erased although the actual file is still there. There is another script in there called nginx that came with the system and doesn't have this problem.



      I am running a Emlid RTK gps that has a linux computer built in.







      sysvinit






      share|improve this question














      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 13 '18 at 2:21









      bakalolobakalolo

      1236 bronze badges




      1236 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          1


















          You should not turn off the device taking off the power cord/battery; hence losing the contents of recently written files.



          Try to use the official procedures to shut it down - power bottom or option in the menu; in the long term the device will be more stable.



          Also if you have got the sync command, use it after writing your file.






          share|improve this answer



























          • Is that the cause of the file going blank though?

            – bakalolo
            Jan 16 '18 at 22:00











          • Most probably yes.

            – Rui F Ribeiro
            Jan 16 '18 at 22:06











          • You have got to run something before shutdown. sync has been the standard for decades now. Have you got it?

            – Rui F Ribeiro
            Jan 16 '18 at 22:13













          • Can't say I will get access to the device to run anything before power off can I make a script that runs sync when it starts up or periodically while power is on?

            – bakalolo
            Jan 16 '18 at 22:19











          • You can run sync manually after creating the script in init.d if you have the command. I do know neither the implementation nor the device to be of further help.

            – Rui F Ribeiro
            Jan 16 '18 at 22:21





















          0


















          This is speculation, as I don't know anything about this product.



          It's possible the entire filesystem has been overwritten.



          In many embedded systems the running filesystem lives in RAM, and is populated from a compressed image in flash (or similar) during a cold boot.



          Alternately a software update may have occurred, which involved replacing the filesystem with a downloaded image.



          On such systems, user settings tend to be stored on a separate filesystem.






          share|improve this answer




























            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            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%2f416727%2fcontent-of-script-in-etc-init-d-deleted-on-restart%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown


























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1


















            You should not turn off the device taking off the power cord/battery; hence losing the contents of recently written files.



            Try to use the official procedures to shut it down - power bottom or option in the menu; in the long term the device will be more stable.



            Also if you have got the sync command, use it after writing your file.






            share|improve this answer



























            • Is that the cause of the file going blank though?

              – bakalolo
              Jan 16 '18 at 22:00











            • Most probably yes.

              – Rui F Ribeiro
              Jan 16 '18 at 22:06











            • You have got to run something before shutdown. sync has been the standard for decades now. Have you got it?

              – Rui F Ribeiro
              Jan 16 '18 at 22:13













            • Can't say I will get access to the device to run anything before power off can I make a script that runs sync when it starts up or periodically while power is on?

              – bakalolo
              Jan 16 '18 at 22:19











            • You can run sync manually after creating the script in init.d if you have the command. I do know neither the implementation nor the device to be of further help.

              – Rui F Ribeiro
              Jan 16 '18 at 22:21


















            1


















            You should not turn off the device taking off the power cord/battery; hence losing the contents of recently written files.



            Try to use the official procedures to shut it down - power bottom or option in the menu; in the long term the device will be more stable.



            Also if you have got the sync command, use it after writing your file.






            share|improve this answer



























            • Is that the cause of the file going blank though?

              – bakalolo
              Jan 16 '18 at 22:00











            • Most probably yes.

              – Rui F Ribeiro
              Jan 16 '18 at 22:06











            • You have got to run something before shutdown. sync has been the standard for decades now. Have you got it?

              – Rui F Ribeiro
              Jan 16 '18 at 22:13













            • Can't say I will get access to the device to run anything before power off can I make a script that runs sync when it starts up or periodically while power is on?

              – bakalolo
              Jan 16 '18 at 22:19











            • You can run sync manually after creating the script in init.d if you have the command. I do know neither the implementation nor the device to be of further help.

              – Rui F Ribeiro
              Jan 16 '18 at 22:21
















            1














            1










            1









            You should not turn off the device taking off the power cord/battery; hence losing the contents of recently written files.



            Try to use the official procedures to shut it down - power bottom or option in the menu; in the long term the device will be more stable.



            Also if you have got the sync command, use it after writing your file.






            share|improve this answer














            You should not turn off the device taking off the power cord/battery; hence losing the contents of recently written files.



            Try to use the official procedures to shut it down - power bottom or option in the menu; in the long term the device will be more stable.



            Also if you have got the sync command, use it after writing your file.







            share|improve this answer













            share|improve this answer




            share|improve this answer










            answered Jan 13 '18 at 12:29









            Rui F RibeiroRui F Ribeiro

            41.8k16 gold badges97 silver badges158 bronze badges




            41.8k16 gold badges97 silver badges158 bronze badges
















            • Is that the cause of the file going blank though?

              – bakalolo
              Jan 16 '18 at 22:00











            • Most probably yes.

              – Rui F Ribeiro
              Jan 16 '18 at 22:06











            • You have got to run something before shutdown. sync has been the standard for decades now. Have you got it?

              – Rui F Ribeiro
              Jan 16 '18 at 22:13













            • Can't say I will get access to the device to run anything before power off can I make a script that runs sync when it starts up or periodically while power is on?

              – bakalolo
              Jan 16 '18 at 22:19











            • You can run sync manually after creating the script in init.d if you have the command. I do know neither the implementation nor the device to be of further help.

              – Rui F Ribeiro
              Jan 16 '18 at 22:21





















            • Is that the cause of the file going blank though?

              – bakalolo
              Jan 16 '18 at 22:00











            • Most probably yes.

              – Rui F Ribeiro
              Jan 16 '18 at 22:06











            • You have got to run something before shutdown. sync has been the standard for decades now. Have you got it?

              – Rui F Ribeiro
              Jan 16 '18 at 22:13













            • Can't say I will get access to the device to run anything before power off can I make a script that runs sync when it starts up or periodically while power is on?

              – bakalolo
              Jan 16 '18 at 22:19











            • You can run sync manually after creating the script in init.d if you have the command. I do know neither the implementation nor the device to be of further help.

              – Rui F Ribeiro
              Jan 16 '18 at 22:21



















            Is that the cause of the file going blank though?

            – bakalolo
            Jan 16 '18 at 22:00





            Is that the cause of the file going blank though?

            – bakalolo
            Jan 16 '18 at 22:00













            Most probably yes.

            – Rui F Ribeiro
            Jan 16 '18 at 22:06





            Most probably yes.

            – Rui F Ribeiro
            Jan 16 '18 at 22:06













            You have got to run something before shutdown. sync has been the standard for decades now. Have you got it?

            – Rui F Ribeiro
            Jan 16 '18 at 22:13







            You have got to run something before shutdown. sync has been the standard for decades now. Have you got it?

            – Rui F Ribeiro
            Jan 16 '18 at 22:13















            Can't say I will get access to the device to run anything before power off can I make a script that runs sync when it starts up or periodically while power is on?

            – bakalolo
            Jan 16 '18 at 22:19





            Can't say I will get access to the device to run anything before power off can I make a script that runs sync when it starts up or periodically while power is on?

            – bakalolo
            Jan 16 '18 at 22:19













            You can run sync manually after creating the script in init.d if you have the command. I do know neither the implementation nor the device to be of further help.

            – Rui F Ribeiro
            Jan 16 '18 at 22:21







            You can run sync manually after creating the script in init.d if you have the command. I do know neither the implementation nor the device to be of further help.

            – Rui F Ribeiro
            Jan 16 '18 at 22:21















            0


















            This is speculation, as I don't know anything about this product.



            It's possible the entire filesystem has been overwritten.



            In many embedded systems the running filesystem lives in RAM, and is populated from a compressed image in flash (or similar) during a cold boot.



            Alternately a software update may have occurred, which involved replacing the filesystem with a downloaded image.



            On such systems, user settings tend to be stored on a separate filesystem.






            share|improve this answer































              0


















              This is speculation, as I don't know anything about this product.



              It's possible the entire filesystem has been overwritten.



              In many embedded systems the running filesystem lives in RAM, and is populated from a compressed image in flash (or similar) during a cold boot.



              Alternately a software update may have occurred, which involved replacing the filesystem with a downloaded image.



              On such systems, user settings tend to be stored on a separate filesystem.






              share|improve this answer





























                0














                0










                0









                This is speculation, as I don't know anything about this product.



                It's possible the entire filesystem has been overwritten.



                In many embedded systems the running filesystem lives in RAM, and is populated from a compressed image in flash (or similar) during a cold boot.



                Alternately a software update may have occurred, which involved replacing the filesystem with a downloaded image.



                On such systems, user settings tend to be stored on a separate filesystem.






                share|improve this answer














                This is speculation, as I don't know anything about this product.



                It's possible the entire filesystem has been overwritten.



                In many embedded systems the running filesystem lives in RAM, and is populated from a compressed image in flash (or similar) during a cold boot.



                Alternately a software update may have occurred, which involved replacing the filesystem with a downloaded image.



                On such systems, user settings tend to be stored on a separate filesystem.







                share|improve this answer













                share|improve this answer




                share|improve this answer










                answered 1 hour ago









                GrumpGrump

                1701 silver badge7 bronze badges




                1701 silver badge7 bronze badges


































                    draft saved

                    draft discarded



















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f416727%2fcontent-of-script-in-etc-init-d-deleted-on-restart%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown









                    Popular posts from this blog

                    Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

                    The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

                    Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...