S98haldaemon 983 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/sh
  2. #
  3. # haldaemon: HAL daemon
  4. #
  5. # chkconfig: 345 98 02
  6. # description: This is a daemon for collecting and maintaing information \
  7. # about hardware from several sources. \
  8. # See http://www.freedesktop.org/Software/hal
  9. #
  10. # processname: hald
  11. # pidfile: /var/run/haldaemon.pid
  12. #
  13. # Sanity checks.
  14. [ -x /usr/sbin/hald ] || exit 0
  15. RETVAL=0
  16. start() {
  17. echo -n "Starting HAL daemon: "
  18. hald
  19. RETVAL=$?
  20. echo "done"
  21. [ $RETVAL -eq 0 ] && touch /var/lock/subsys/haldaemon
  22. }
  23. stop() {
  24. echo -n "Stopping HAL daemon: "
  25. killall hald
  26. RETVAL=$?
  27. echo "done"
  28. if [ $RETVAL -eq 0 ]; then
  29. rm -f /var/lock/subsys/haldaemon
  30. rm -f /var/run/haldaemon.pid
  31. fi
  32. }
  33. # See how we were called.
  34. case "$1" in
  35. start)
  36. start
  37. ;;
  38. stop)
  39. stop
  40. ;;
  41. restart)
  42. stop
  43. sleep 3
  44. start
  45. ;;
  46. *)
  47. echo $"Usage: $0 {start|stop|restart}"
  48. ;;
  49. esac
  50. exit $RETVAL