1
0

sysklogd 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/sh
  2. # Begin $RC_BASE/init.d/sysklogd
  3. ### BEGIN INIT INFO
  4. # Provides: $syslog
  5. # Required-Start: localnet
  6. # Should-Start:
  7. # Required-Stop: $local_fs sendsignals
  8. # Should-Stop:
  9. # Default-Start: 2 3 4 5
  10. # Default-Stop: 0 1 6
  11. # Short-Description: Starts kernel and system log daemons.
  12. # Description: Starts kernel and system log daemons.
  13. # /etc/fstab.
  14. # X-LFS-Provided-By: LFS
  15. ### END INIT INFO
  16. . /lib/lsb/init-functions
  17. case "${1}" in
  18. start)
  19. MESSAGE="system log daemon..."
  20. start_daemon /sbin/syslogd -m 0
  21. evaluate_retval start
  22. MESSAGE="kernel log daemon..."
  23. start_daemon /sbin/klogd
  24. evaluate_retval start
  25. ;;
  26. stop)
  27. MESSAGE="kernel log daemon..."
  28. killproc /sbin/klogd
  29. evaluate_retval stop
  30. MESSAGE="system log daemon..."
  31. killproc /sbin/syslogd
  32. evaluate_retval stop
  33. ;;
  34. force-reload)
  35. MESSAGE="system log daemon config file..."
  36. killproc -HUP `/sbin/syslogd`
  37. evaluate_retval reload
  38. ;;
  39. restart)
  40. MESSAGE="system and kernel log deamons..."
  41. failed=0
  42. killproc /sbin/klogd || failed=1
  43. killproc /sbin/syslogd || failed=1
  44. start_daemon /sbin/syslogd -m 0 || failed=1
  45. start_daemon /sbin/klogd || failed=1
  46. (exit ${failed})
  47. evaluate_retval restart
  48. ;;
  49. status)
  50. statusproc /sbin/syslogd
  51. statusproc /sbin/klogd
  52. ;;
  53. *)
  54. echo "Usage: ${0} {start|stop|force-reload|restart|status}"
  55. exit 1
  56. ;;
  57. esac
  58. # End $RC_BASE/init.d/sysklogd