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







New contributor




Mulligun007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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







New contributor




Mulligun007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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







New contributor




Mulligun007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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







New contributor




Mulligun007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Mulligun007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Mulligun007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 21 at 11:16









Mulligun007

61




61




New contributor




Mulligun007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Mulligun007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Mulligun007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • 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
    });


    }
    });






    Mulligun007 is a new contributor. Be nice, and check out our Code of Conduct.










     

    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

        2925




        2925






















            Mulligun007 is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            Mulligun007 is a new contributor. Be nice, and check out our Code of Conduct.













            Mulligun007 is a new contributor. Be nice, and check out our Code of Conduct.












            Mulligun007 is a new contributor. Be nice, and check out our Code of Conduct.















             


            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

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

            Eduardo VII do Reino Unido