1
0

sendsignals 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. # Begin $RC_BASE/init.d/sendsignals
  3. ### BEGIN INIT INFO
  4. # Provides: sendsignals
  5. # Required-Start:
  6. # Should-Start:
  7. # Required-Stop: $local_fs swap localnet
  8. # Should-Stop:
  9. # Default-Start:
  10. # Default-Stop: 0 6
  11. # Short-Description: Attempts to kill remaining processes.
  12. # Description: Attempts to kill remaining processes.
  13. # X-LFS-Provided-By: LFS
  14. ### END INIT INFO
  15. . /lib/lsb/init-functions
  16. case "${1}" in
  17. stop)
  18. message="Sending all processes the TERM signal..."
  19. killall5 -15
  20. error_value=${?}
  21. # Account for successful return value of 2
  22. if [ ${error_value} -eq 2 ]; then
  23. error_value=0
  24. fi
  25. sleep 3
  26. (exit ${error_value})
  27. evaluate_retval standard
  28. message="Sending all processes the KILL signal..."
  29. killall5 -9
  30. error_value=${?}
  31. # Account for successful return value of 2
  32. if [ ${error_value} -eq 2 ]; then
  33. error_value=0
  34. fi
  35. sleep 3
  36. (exit ${error_value})
  37. evaluate_retval standard
  38. ;;
  39. *)
  40. echo "Usage: ${0} {stop}"
  41. exit 1
  42. ;;
  43. esac
  44. # End $RC_BASE/init.d/sendsignals