sendsignals.xml 819 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. <para>
  8. <screen>
  9. <userinput>cat &gt; sendsignals &lt;&lt; "EOF"</userinput>
  10. #!/bin/sh
  11. # Begin /etc/init.d/sendsignals
  12. #
  13. # Include the functions declared in the /etc/init.d/functions file
  14. #
  15. source /etc/init.d/functions
  16. #
  17. # Send all the remaining processes the TERM signal
  18. #
  19. echo -n "Sending all processes the TERM signal..."
  20. /sbin/killall5 -15
  21. evaluate_retval
  22. #
  23. # Send all the remaining process (after sending them the TERM signal
  24. # before) the KILL signal.
  25. #
  26. echo -n "Sending all processes the KILL signal..."
  27. /sbin/killall5 -9
  28. evaluate_retval
  29. # End /etc/init.d/sendsignals
  30. <userinput>EOF</userinput>
  31. </screen>
  32. </para>
  33. </sect1>