The final init script file
The file "/etc/rc.d/rc3.d/S99.local" is a link file to the file "/etc/rc.d/rc.local". Below is a listing of the "rc.local" file:
1 #!/bin/sh
2
3 # This script will be executed *after* all the other init scripts.
4 # You can put your own initialization stuff in here if you don't
5 # want to do the full Sys V style init stuff.
6
7 if [ -f /etc/redhat-release ]; then
8 R=$(cat /etc/redhat-release)
9
10 arch=$(uname -m)
11 a="a"
12 case "_$arch" in
13 _a*) a="an";;
14 _i*) a="an";;
15 esac
16
17 # This will overwrite /etc/issue at every boot. So, make any changes you
18 # want to make to /etc/issue here or you will lose them when you reboot.
19 echo "" > /etc/issue
20 echo "$R" >> /etc/issue
21 echo "Kernel $(uname -r) on $a $(uname -m)" >> /etc/issue
22
23 cp -f /etc/issue /etc/issue.net
24 echo >> /etc/issue
25 fi
|
|
On line 7, the script file looks for the file "/etc/redhat-release" and assigns the contents of that file to the variable "R" on line 8. On line 10 the variable "arch" is assigned the machine type using the command "uname –m". See the man page on uname for more information. The lines 10 through 15 set up the variable "a" to be an "a" or an "an" depending on the first character of the variable "arch" (the machine name). This is for later use when the kernel version and machine name are output to the issue files. On line 19, the "/etc/issue" file is cleared. On line 20, the Redhat release version is copied into the file. On line 21, the kernel version number and machine type are copied into the issue file. The issue file is output to the terminal by the getty (Note, in our case this is mingetty which is designated in the "/etc/inittab" file) program every time a user performs a login through a terminal. On line 23, the file "/etc/issue" is copied to the file "/etc/issue.net" which is used for network logins.
|