rcS.xml 741 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. <literallayout>
  8. <userinput>cat &gt; rcS &lt;&lt; "EOF"</userinput>
  9. #!/bin/sh
  10. # Begin /etc/init.d/rcS
  11. #
  12. # See the rc script for the extensive comments on the constructions
  13. # used here
  14. #
  15. runlevel=S
  16. prevlevel=N
  17. umask 022
  18. export runlevel prevlevel
  19. trap ":" INT QUIT TSTP
  20. #
  21. # Collect all the S scripts in /etc/rcS.d and execute them
  22. #
  23. for i in /etc/rcS.d/S*
  24. do
  25. [ ! -f "$i" ] &amp;&amp; continue;
  26. $i start
  27. done
  28. # End /etc/init.d/rcS
  29. <userinput>EOF</userinput>
  30. </literallayout>
  31. </sect1>