rcS.xml 751 B

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