Run script during system boot











up vote
1
down vote

favorite












I'd like to run a script while system initialization. To do so I've placed my test script in standard system init directories (like described here):



/etc/rc.d/rc.test
/etc/rc.d/rc3.d/rc.test
/etc/rc.d/init.d/rc.test


but none of that works. My test script just isn't run during system startup.



I'm running Slackware 4.4.14










share|improve this question






















  • does the script have execute permissions? objects in rc.d folders are usually symlinks to scripts with -rwxr-xr-x permissions
    – rAlen
    Nov 21 at 11:27












  • Yes of course it has execute permissions set.
    – Mulligun007
    Nov 21 at 11:33










  • @rAlen any idea then?
    – Mulligun007
    Nov 21 at 11:45










  • does the script run normally when you run it manually, try putting it in /etc/init.d/ and creating symlink to it in /etc/rc.d/.
    – rAlen
    Nov 21 at 11:50















up vote
1
down vote

favorite












I'd like to run a script while system initialization. To do so I've placed my test script in standard system init directories (like described here):



/etc/rc.d/rc.test
/etc/rc.d/rc3.d/rc.test
/etc/rc.d/init.d/rc.test


but none of that works. My test script just isn't run during system startup.



I'm running Slackware 4.4.14










share|improve this question






















  • does the script have execute permissions? objects in rc.d folders are usually symlinks to scripts with -rwxr-xr-x permissions
    – rAlen
    Nov 21 at 11:27












  • Yes of course it has execute permissions set.
    – Mulligun007
    Nov 21 at 11:33










  • @rAlen any idea then?
    – Mulligun007
    Nov 21 at 11:45










  • does the script run normally when you run it manually, try putting it in /etc/init.d/ and creating symlink to it in /etc/rc.d/.
    – rAlen
    Nov 21 at 11:50













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'd like to run a script while system initialization. To do so I've placed my test script in standard system init directories (like described here):



/etc/rc.d/rc.test
/etc/rc.d/rc3.d/rc.test
/etc/rc.d/init.d/rc.test


but none of that works. My test script just isn't run during system startup.



I'm running Slackware 4.4.14










share|improve this question













I'd like to run a script while system initialization. To do so I've placed my test script in standard system init directories (like described here):



/etc/rc.d/rc.test
/etc/rc.d/rc3.d/rc.test
/etc/rc.d/init.d/rc.test


but none of that works. My test script just isn't run during system startup.



I'm running Slackware 4.4.14







linux






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 at 11:16









Mulligun007

111




111












  • does the script have execute permissions? objects in rc.d folders are usually symlinks to scripts with -rwxr-xr-x permissions
    – rAlen
    Nov 21 at 11:27












  • Yes of course it has execute permissions set.
    – Mulligun007
    Nov 21 at 11:33










  • @rAlen any idea then?
    – Mulligun007
    Nov 21 at 11:45










  • does the script run normally when you run it manually, try putting it in /etc/init.d/ and creating symlink to it in /etc/rc.d/.
    – rAlen
    Nov 21 at 11:50


















  • does the script have execute permissions? objects in rc.d folders are usually symlinks to scripts with -rwxr-xr-x permissions
    – rAlen
    Nov 21 at 11:27












  • Yes of course it has execute permissions set.
    – Mulligun007
    Nov 21 at 11:33










  • @rAlen any idea then?
    – Mulligun007
    Nov 21 at 11:45










  • does the script run normally when you run it manually, try putting it in /etc/init.d/ and creating symlink to it in /etc/rc.d/.
    – rAlen
    Nov 21 at 11:50
















does the script have execute permissions? objects in rc.d folders are usually symlinks to scripts with -rwxr-xr-x permissions
– rAlen
Nov 21 at 11:27






does the script have execute permissions? objects in rc.d folders are usually symlinks to scripts with -rwxr-xr-x permissions
– rAlen
Nov 21 at 11:27














Yes of course it has execute permissions set.
– Mulligun007
Nov 21 at 11:33




Yes of course it has execute permissions set.
– Mulligun007
Nov 21 at 11:33












@rAlen any idea then?
– Mulligun007
Nov 21 at 11:45




@rAlen any idea then?
– Mulligun007
Nov 21 at 11:45












does the script run normally when you run it manually, try putting it in /etc/init.d/ and creating symlink to it in /etc/rc.d/.
– rAlen
Nov 21 at 11:50




does the script run normally when you run it manually, try putting it in /etc/init.d/ and creating symlink to it in /etc/rc.d/.
– rAlen
Nov 21 at 11:50










1 Answer
1






active

oldest

votes

















up vote
0
down vote













There are a few things that must be done correctly when creating custom SysV init startup scripts. First, they must be in the correct directory. Typically the init scripts are placed in /etc/init.d or /etc/rc.d or /etc/init.d/rc.d, whichever directory your OS distribution uses. Then, a symbolic link of the correct name must be made in the correct run level directory. You can check /etc/inittab for a line with the word default or defaultinit or similar. There is a number in there. That will tell you the default run level when your system boots up. For example, for most systems, the default run level is 5. That means a symbolic link needs to go into the /etc/rc5.d, /etc/init.d/rc5.d or similar directory. That link needs to start with a S followed by 2 digits and then whatever name you want. For example, /etc/rc.d/rc5.d/S99rc.test would be a symbolic link to /etc/rc.d/init.d/rc.test.



The tool chkconfig does all of this for you. Your script needs to have a certain set of comments for chkconfig to work correctly. Check the chkconfig man page for more info.



Hope this helps.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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/3.0/"u003ecc by-sa 3.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%2fsuperuser.com%2fquestions%2f1377248%2frun-script-during-system-boot%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    There are a few things that must be done correctly when creating custom SysV init startup scripts. First, they must be in the correct directory. Typically the init scripts are placed in /etc/init.d or /etc/rc.d or /etc/init.d/rc.d, whichever directory your OS distribution uses. Then, a symbolic link of the correct name must be made in the correct run level directory. You can check /etc/inittab for a line with the word default or defaultinit or similar. There is a number in there. That will tell you the default run level when your system boots up. For example, for most systems, the default run level is 5. That means a symbolic link needs to go into the /etc/rc5.d, /etc/init.d/rc5.d or similar directory. That link needs to start with a S followed by 2 digits and then whatever name you want. For example, /etc/rc.d/rc5.d/S99rc.test would be a symbolic link to /etc/rc.d/init.d/rc.test.



    The tool chkconfig does all of this for you. Your script needs to have a certain set of comments for chkconfig to work correctly. Check the chkconfig man page for more info.



    Hope this helps.






    share|improve this answer

























      up vote
      0
      down vote













      There are a few things that must be done correctly when creating custom SysV init startup scripts. First, they must be in the correct directory. Typically the init scripts are placed in /etc/init.d or /etc/rc.d or /etc/init.d/rc.d, whichever directory your OS distribution uses. Then, a symbolic link of the correct name must be made in the correct run level directory. You can check /etc/inittab for a line with the word default or defaultinit or similar. There is a number in there. That will tell you the default run level when your system boots up. For example, for most systems, the default run level is 5. That means a symbolic link needs to go into the /etc/rc5.d, /etc/init.d/rc5.d or similar directory. That link needs to start with a S followed by 2 digits and then whatever name you want. For example, /etc/rc.d/rc5.d/S99rc.test would be a symbolic link to /etc/rc.d/init.d/rc.test.



      The tool chkconfig does all of this for you. Your script needs to have a certain set of comments for chkconfig to work correctly. Check the chkconfig man page for more info.



      Hope this helps.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        There are a few things that must be done correctly when creating custom SysV init startup scripts. First, they must be in the correct directory. Typically the init scripts are placed in /etc/init.d or /etc/rc.d or /etc/init.d/rc.d, whichever directory your OS distribution uses. Then, a symbolic link of the correct name must be made in the correct run level directory. You can check /etc/inittab for a line with the word default or defaultinit or similar. There is a number in there. That will tell you the default run level when your system boots up. For example, for most systems, the default run level is 5. That means a symbolic link needs to go into the /etc/rc5.d, /etc/init.d/rc5.d or similar directory. That link needs to start with a S followed by 2 digits and then whatever name you want. For example, /etc/rc.d/rc5.d/S99rc.test would be a symbolic link to /etc/rc.d/init.d/rc.test.



        The tool chkconfig does all of this for you. Your script needs to have a certain set of comments for chkconfig to work correctly. Check the chkconfig man page for more info.



        Hope this helps.






        share|improve this answer












        There are a few things that must be done correctly when creating custom SysV init startup scripts. First, they must be in the correct directory. Typically the init scripts are placed in /etc/init.d or /etc/rc.d or /etc/init.d/rc.d, whichever directory your OS distribution uses. Then, a symbolic link of the correct name must be made in the correct run level directory. You can check /etc/inittab for a line with the word default or defaultinit or similar. There is a number in there. That will tell you the default run level when your system boots up. For example, for most systems, the default run level is 5. That means a symbolic link needs to go into the /etc/rc5.d, /etc/init.d/rc5.d or similar directory. That link needs to start with a S followed by 2 digits and then whatever name you want. For example, /etc/rc.d/rc5.d/S99rc.test would be a symbolic link to /etc/rc.d/init.d/rc.test.



        The tool chkconfig does all of this for you. Your script needs to have a certain set of comments for chkconfig to work correctly. Check the chkconfig man page for more info.



        Hope this helps.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 at 13:32









        Lewis M

        3075




        3075






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • 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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2fsuperuser.com%2fquestions%2f1377248%2frun-script-during-system-boot%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

            Plaza Victoria

            In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

            How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...