📄 rcs.html
字号:
<HTML><HEAD><TITLE>Creating the rcS script</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.63"><LINKREL="HOME"TITLE="Linux From Scratch"HREF="../index.html"><LINKREL="UP"TITLE="Creating system boot scripts"HREF="../chapter07/chapter07.html"><LINKREL="PREVIOUS"TITLE="Creating the rc script"HREF="../chapter07/rc.html"><LINKREL="NEXT"TITLE="Creating the functions script"HREF="../chapter07/functions.html"></HEAD><BODYCLASS="sect1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Linux From Scratch: Version 3.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="../chapter07/rc.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 7. Creating system boot scripts</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="../chapter07/functions.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="ch07-rcS">7.5. Creating the rcS script</A></H1><P>The second main boot script is the <TTCLASS="filename">rcS</TT> script. Create the <TTCLASS="filename">/etc/init.d/rcS</TT> script by running the followingcommand:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cat > /etc/init.d/rcS << "EOF"</B></TT>#!/bin/sh# Begin /etc/init.d/rcS## See the rc script for the extensive comments on the constructions# used here#source /etc/init.d/functionsprint_error_msg(){ echo $FAILURE echo -n "You should not read this error message. It means " echo "that an unforeseen error " echo -n "took place and subscript $i exited with " echo "a return value " echo -n "of $error_value for an unknown reason. If you're able " echo "to trace this error down " echo -n "to a bug in one of the files provided by this book, " echo "please be so kind to " echo -n "inform us at lfs-dev@linuxfromscratch.org" $NORMAL echo echo echo "Press a key to continue..." read}runlevel=Sprevlevel=Numask 022export runlevel prevleveltrap ":" INT QUIT TSTP## Collect all the S scripts in /etc/rcS.d and execute them#for i in /etc/rcS.d/S*do [ ! -f "$i" ] && continue; $i start error_value=$? if [ $error_value != 0 ] then print_error_msg fidone# End /etc/init.d/rcS<TTCLASS="userinput"><B>EOF</B></TT></PRE></FONT></TD></TR></TABLE></P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="../chapter07/rc.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="../chapter07/functions.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Creating the rc script</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../chapter07/chapter07.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Creating the functions script</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -