Results 1 to 8 of 8
Hi,
I wish to enable my shell script to automatically run whenever my system starts up.
What should be the steps, Plz reply!!!!!
Thanks...
- 10-30-2007 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 3
automating a shell script
Hi,
I wish to enable my shell script to automatically run whenever my system starts up.
What should be the steps, Plz reply!!!!!
Thanks
- 10-30-2007 #2Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Place the command in your .bashrc file.
Regards
- 10-30-2007 #3
Franklin52, that won't quite do it. That will only execute the script when the user starts a new interactive bash session (other than when he logs in), or when the user runs ~/.bashrc explicitly. Of course, the whole concept of "~" (the username) doesn't make sense when the system is still coming up and nobody has logged in yet.
Babul Rk, the answer depends on which distribution of Linux you're running, and whether you want to
- make this script part of the boot process itself (that is, run for a short while to set things up and then exit); or
- run interactively through the screen and keyboard.
So we need two things: your distribution, and whether you want keyboard interaction.
- 10-30-2007 #4Just Joined!
- Join Date
- Oct 2007
- Posts
- 2
hi,
Place your script /etc/rc.local
- 10-30-2007 #5That may work in some distributions, but it won't work in (for example) Slackware. In Slackware, you want to name your script in the script /etc/rc.d/rc.localPlace your script /etc/rc.local
That's why I asked Babul Rk which distribution he was running.
- 10-30-2007 #6Just Joined!
- Join Date
- Oct 2007
- Posts
- 3
I am running both RH 4 and FC 4, and i donot want a keyboard interaction.
I appreciate for your reply and looking forward for more.
Thanks
- 10-30-2007 #7
It should work the same on both RH and FC.
I don't know anything about those systems, but I googled. If you have on your system a file called /etc/rc.d/rc.local, place the full pathname of your script in there.
Please note that the system won't finish booting until after your script has finished running. If it's something that is to be run forever, even after the system has come up all the way, place an ampersand & at the end of the line that names your script. That way, the system won't wait for your script to complete (or even run very long) before continuing the booting sequence.
I see web-rumors that /etc/rc.local is a symbolic link to /etc/rc.d/rc.local. I can't verify this; you'll have to look for yourself.
But the name of the file to contain your script name, /etc/rc.d/rc.local, is just a guess. Is there any Red Hat/Fedora expert out there?
- 10-30-2007 #8Just Joined!
- Join Date
- Oct 2007
- Posts
- 3
Well thats hard to find but let me check and get back.
Thanks


Reply With Quote