ntpd 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin ntpd
  4. #
  5. # Description : Start Network Time Protocol daemon
  6. #
  7. # Author : DJ Lucas - dj@linuxfromscratch.org
  8. # Bruce Dubbs - bdubbs@linuxfromscratch.org
  9. #
  10. # Version : LFS 7.0
  11. #
  12. ########################################################################
  13. ### BEGIN INIT INFO
  14. # Provides: ntpd
  15. # Required-Start: $time $network
  16. # Should-Start: $remote_fs
  17. # Required-Stop: $network
  18. # Should-Stop: $remote_fs
  19. # Default-Start: 3 4 5
  20. # Default-Stop: 0 1 2 6
  21. # Short-Description: NTP Network Time Protocol
  22. # Description: NTP Syncronizes time with time servers worldwide
  23. # X-LFS-Provided-By: BLFS / LFS 7.0
  24. ### END INIT INFO
  25. . /lib/lsb/init-functions
  26. #$LastChangedBy: igor $
  27. #$Date: 2013-08-02 15:27:17 -0500 (Fri, 02 Aug 2013) $
  28. case "$1" in
  29. start)
  30. log_info_msg "Starting ntpd..."
  31. start_daemon /usr/sbin/ntpd -g -u ntp:ntp
  32. evaluate_retval
  33. ;;
  34. stop)
  35. log_info_msg "Stopping ntpd..."
  36. killproc /usr/sbin/ntpd
  37. evaluate_retval
  38. ;;
  39. restart)
  40. $0 stop
  41. sleep 1
  42. $0 start
  43. ;;
  44. status)
  45. statusproc /usr/sbin/ntpd
  46. ;;
  47. *)
  48. echo "Usage: $0 {start|stop|restart|status}"
  49. exit 1
  50. ;;
  51. esac
  52. # End ntpd