18.Explain the rc script and how they can be managed by manually.
Ans.
1. ‘rc’ scripts are stored in ‘/etc/rc.d’ directory, rc scripts are used to stop and start services for runlevels.
2. In ‘/etc/rc.d’ directory we have some additional directories rc0.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d and rc6.d, the numbers in directory name corresponds to the runlevel and contains the scripts for runlevels.
3. For example let’s take runlevel 5, init program looks in the ‘/etc/rc.d/rc5.d/’ directory for the processes to start and stop.
4. All the scripts in the rc5.d directory are symbolic like to the actual scripts that are located in the ‘/etc/rc.d/init.d/’ directory. The use of symbolic link means that the runlevel can be modified by adding or removing symlinks or changing the order the script run.
5. rc scripts contains symbolic links which can be modified to change the runlevels.
6. Symbolic links begins with a ‘k’ and a number or an ‘s’ and a number.
Example:
S25netfs --> ../init.d/netfs
K74ntpd --> ../init.d/ntpd
7. All the process begins with ‘K’ are stopped first then all the process begins with ‘S’ are started.
8. The process are stopped and started in numerical order, beginning with lowest and continuing in increasing order.
9. Processes are stopped by the ‘/etc/rc.d/init.d/ process stop’ command and started by ‘/etc/rc.d/init.d/ process start’.
10. If we desire we can change the stop and start order by changing the numbers in symbolic link.
Ans.
1. ‘rc’ scripts are stored in ‘/etc/rc.d’ directory, rc scripts are used to stop and start services for runlevels.
2. In ‘/etc/rc.d’ directory we have some additional directories rc0.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d and rc6.d, the numbers in directory name corresponds to the runlevel and contains the scripts for runlevels.
3. For example let’s take runlevel 5, init program looks in the ‘/etc/rc.d/rc5.d/’ directory for the processes to start and stop.
4. All the scripts in the rc5.d directory are symbolic like to the actual scripts that are located in the ‘/etc/rc.d/init.d/’ directory. The use of symbolic link means that the runlevel can be modified by adding or removing symlinks or changing the order the script run.
5. rc scripts contains symbolic links which can be modified to change the runlevels.
6. Symbolic links begins with a ‘k’ and a number or an ‘s’ and a number.
Example:
S25netfs --> ../init.d/netfs
K74ntpd --> ../init.d/ntpd
7. All the process begins with ‘K’ are stopped first then all the process begins with ‘S’ are started.
8. The process are stopped and started in numerical order, beginning with lowest and continuing in increasing order.
9. Processes are stopped by the ‘/etc/rc.d/init.d/ process stop’ command and started by ‘/etc/rc.d/init.d/ process start’.
10. If we desire we can change the stop and start order by changing the numbers in symbolic link.
Comments
Post a Comment