sendsignals.xml 818 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <sect1 id="ch07-sendsignals">
  2. <title>Creating the sendsignals script</title>
  3. <para>
  4. Create a new file <filename>/etc/init.d/sendsignals</filename>
  5. containing the following:
  6. </para>
  7. <literallayout>
  8. <userinput>cat &gt; sendsignals &lt;&lt; "EOF"</userinput>
  9. #!/bin/sh
  10. # Begin /etc/init.d/sendsignals
  11. #
  12. # Include the functions declared in the /etc/init.d/functions file
  13. #
  14. source /etc/init.d/functions
  15. #
  16. # Send all the remaining processes the TERM signal
  17. #
  18. echo -n "Sending all processes the TERM signal..."
  19. /sbin/killall5 -15
  20. evaluate_retval
  21. #
  22. # Send all the remaining process (after sending them the TERM signal
  23. # before) the KILL signal.
  24. #
  25. echo -n "Sending all processes the KILL signal..."
  26. /sbin/killall5 -9
  27. evaluate_retval
  28. # End /etc/init.d/sendsignals
  29. <userinput>EOF</userinput>
  30. </literallayout>
  31. </sect1>