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
New contributor
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
New contributor
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
New contributor
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
New contributor
New contributor
New contributor
asked Nov 21 at 11:16
Mulligun007
61
61
New contributor
New contributor
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
2925
2925
add a comment |
add a comment |
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.
Mulligun007 is a new contributor. Be nice, and check out our Code of Conduct.
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