![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| rsh help - getting the output of remote script to local server. | aster007 | Shell Programming and Scripting | 5 | 03-07-2009 10:14 AM |
| How to stop a script running in remote server from local script | mannepalli | Shell Programming and Scripting | 1 | 03-04-2009 08:18 PM |
| Executing shell script on local machine | jakSun8 | Shell Programming and Scripting | 4 | 07-02-2008 01:32 PM |
| How to make variables in script function local? | alex_5161 | Shell Programming and Scripting | 5 | 03-07-2008 02:03 PM |
| Shell script to create local homes | Steve Adcock | Shell Programming and Scripting | 11 | 10-25-2004 04:18 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Script under rc3.d Vs rc.local
Which of the following gets executed first?
script under rc3.d Vs script under rc.local I was under impression that rc3.d has higher precedence over rc.local. Somehow it looks like the script under rc.local got executed first than the one under rc3.d. I had to manually start them in order for the application to work. any suggestions? |
|
||||
|
Mark,
Thank you for the response. I can't recall on how I started assuming that runlevel scripts have priority. While I was searching online in regards to when rc.local, many sites have listed that rc.local gets executed every time a runlevel changes. "Every time runlevel changes" - Is this during the boot process? ---------- Post updated at 04:58 PM ---------- Previous update was at 04:14 PM ---------- It seems like rc.local is being executed multiple times: ./rc2.d/S99local ./rc3.d/S99local ./rc4.d/S99local ./rc5.d/S99local |
|
||||
|
what does S99local correspond to? The distro I use, SUSE, has boot.local, which takes the place of rc.local for them, and it is executed before a runlevel is reached.
---------- Post updated at 11:11 AM ---------- Previous update was at 10:55 AM ---------- An introduction to services, runlevels, and rc.d scripts If this all still sounds a bit too complicated, you can instead simply make use of the /etc/rc.d/rc.local file. This script file is run once, before all other scripts have run but before the logon prompt appears. By default it looks something like: #!/bin/bash## /etc/rc.local - run once at boot time # Put any local setup commands in here: |
|
||||
|
rc.local is the last thing run after the run level is reached. That is why under the rc.d directories it is listed with the 99. It is the last to run.
If you create a script to run under the rc.d/ directories, you have to assign it a number and it will run in order. |
|
||||
|
Please read the link I submitted. You are wrong, Six. rc.local is executed before anything else
More proof: http://www.fedorafaq.org/basics/ Q: How do I run something when the computer starts? A: You have two choices, either you can run something before anybody logs in, or you can run something immediately after you log in. To run a command right after you boot, before anybody logs in, add the command to the file /etc/rc.local: |
|
||||
|
Quote:
"To run a command right after you boot, before anybody logs in, add the command to the file /etc/rc.local:" The OP asked which runs first, script under rc3.d or scirpt "under" rc.local. I put under in quotes because in the Redhat server I'm looking at right now rc.local is a script, not a directory. On top of that the question is weird because rc.local is one of the scripts that is executed if you go to run level 3. The scripts executed when a run level is applied have symbolic links in /etc/rc.d/rc<number>.d/ and have a name like S<number><name>. The scripts are executed by /etc/rc.d/rc which, if you look at it, just runs them through a for loop. The are executed in alphabetical order so S01blah gets executed before S02blah which gets executed before S02blat. The symbolic link for rc.local is usually S99local which puts it "near" the end. I say "near" because, while it's inteded to be at the end, it's possible to have scripts execute after it. You can do that by creating a symbolic link named S99<something_aphabetically_after_local>. MG |
| Sponsored Links | ||
|
|