sendsignals 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin sendsignals
  4. #
  5. # Description : Sendsignals Script
  6. #
  7. # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
  8. # DJ Lucas - dj@linuxfromscratch.org
  9. # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
  10. #
  11. # Version : LFS 7.0
  12. #
  13. ########################################################################
  14. ### BEGIN INIT INFO
  15. # Provides: sendsignals
  16. # Required-Start:
  17. # Should-Start:
  18. # Required-Stop: $local_fs swap localnet
  19. # Should-Stop:
  20. # Default-Start:
  21. # Default-Stop: 0 6
  22. # Short-Description: Attempts to kill remaining processes.
  23. # Description: Attempts to kill remaining processes.
  24. # X-LFS-Provided-By: LFS
  25. ### END INIT INFO
  26. . /lib/lsb/init-functions
  27. case "${1}" in
  28. stop)
  29. log_info_msg "Sending all processes the TERM signal..."
  30. killall5 -15
  31. error_value=${?}
  32. sleep ${KILLDELAY}
  33. if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then
  34. log_success_msg
  35. else
  36. log_failure_msg
  37. fi
  38. log_info_msg "Sending all processes the KILL signal..."
  39. killall5 -9
  40. error_value=${?}
  41. sleep ${KILLDELAY}
  42. if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then
  43. log_success_msg
  44. else
  45. log_failure_msg
  46. fi
  47. ;;
  48. *)
  49. echo "Usage: ${0} {stop}"
  50. exit 1
  51. ;;
  52. esac
  53. exit 0
  54. # End sendsignals