sendsignals.xml 888 B

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