gpm 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/sh
  2. #######################################################################
  3. # Begin /etc/init.d/gpm
  4. #
  5. # Description : Start GPM Console Mouse Service
  6. #
  7. # Author : DJ Lucas - dj@linuxfromscratch.org
  8. #
  9. # Version : LFS 7.0
  10. #
  11. ########################################################################
  12. ### BEGIN INIT INFO
  13. # Provides: gpm
  14. # Required-Start: $network $local_fs
  15. # Should-Start:
  16. # Required-Stop: $local_fs $network
  17. # Should-Stop:
  18. # Default-Start: 3 4 5
  19. # Default-Stop: 0 1 2 6
  20. # Short-Description: Starts and stops the GPM console mouse service.
  21. # Description: Starts and stops the GPM console mouse service.
  22. # X-LFS-Provided-By: BLFS / LFS 7.0
  23. ### END INIT INFO
  24. . /etc/rc.d/functions
  25. #$LastChangedBy: bdubbs $
  26. #$Date: 2012-03-23 21:43:45 -0500 (Fri, 23 Mar 2012) $
  27. pidfile="/run/gpm.pid"
  28. [ -f /etc/sysconfig/mouse ] && source /etc/sysconfig/mouse
  29. case "${1}" in
  30. start)
  31. log_info_msg "Starting GPM console mouse service..."
  32. start_daemon /usr/bin/gpm -m /dev/input/mice -t imps2
  33. evaluate_retval
  34. ;;
  35. stop)
  36. log_info_msg "Stopping GPM console mouse service..."
  37. killproc /usr/bin/gpm
  38. evaluate_retval
  39. ;;
  40. force-reload)
  41. # gpm does not honor SIGHUP, restart if running
  42. kill -0 `pidofproc -p "${pidfile}" /usr/sbin/gpm` 2>/dev/null
  43. if [ "${?}" = "0" ]; then
  44. ${0} restart
  45. else
  46. log_info_msg "Force reloading GPM console mouse service..."
  47. log_info_msg2 "not running"
  48. log_failure_msg
  49. fi
  50. ;;
  51. restart)
  52. ${0} stop
  53. sleep 1
  54. ${0} start
  55. ;;
  56. status)
  57. statusproc /usr/sbin/gpm
  58. ;;
  59. *)
  60. echo "Usage: ${0} {start|stop|force-reload|restart|status}"
  61. exit 1
  62. ;;
  63. esac
  64. exit 0
  65. # End /etc/init.d/gpm