1
0

sendsignals 1.3 KB

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