rcS.xml 742 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <sect1 id="ch07-rcS">
  2. <title>Creating the rcS script</title>
  3. <para>
  4. The second main boot script is the <filename>rcS</filename> script. Create a
  5. new file <filename>/etc/init.d/rcS</filename> containing the following:
  6. </para>
  7. <para>
  8. <screen>
  9. <userinput>cat &gt; rcS &lt;&lt; "EOF"</userinput>
  10. #!/bin/sh
  11. # Begin /etc/init.d/rcS
  12. #
  13. # See the rc script for the extensive comments on the constructions
  14. # used here
  15. #
  16. runlevel=S
  17. prevlevel=N
  18. umask 022
  19. export runlevel prevlevel
  20. trap ":" INT QUIT TSTP
  21. #
  22. # Collect all the S scripts in /etc/rcS.d and execute them
  23. #
  24. for i in /etc/rcS.d/S*
  25. do
  26. [ ! -f "$i" ] &amp;&amp; continue;
  27. $i start
  28. done
  29. # End /etc/init.d/rcS
  30. <userinput>EOF</userinput>
  31. </screen>
  32. </para>
  33. </sect1>