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
linux
add a comment |
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
linux
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
add a comment |
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
linux
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
linux
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
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 21 at 13:32
Lewis M
3075
3075
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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