sysklogd 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin sysklogd
  4. #
  5. # Description : Sysklogd loader
  6. #
  7. # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
  8. # DJ Lucas - dj@linuxfromscratch.org
  9. # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
  10. #
  11. # Version : LFS 7.0
  12. #
  13. ########################################################################
  14. ### BEGIN INIT INFO
  15. # Provides: $syslog
  16. # Required-Start: localnet
  17. # Should-Start:
  18. # Required-Stop: $local_fs sendsignals
  19. # Should-Stop:
  20. # Default-Start: 3 4 5
  21. # Default-Stop: 0 1 2 6
  22. # Short-Description: Starts kernel and system log daemons.
  23. # Description: Starts kernel and system log daemons.
  24. # /etc/fstab.
  25. # X-LFS-Provided-By: LFS
  26. ### END INIT INFO
  27. # Note: sysklogd is not started in runlevel 2 due to possible
  28. # remote logging configurations
  29. . /lib/lsb/init-functions
  30. case "${1}" in
  31. start)
  32. log_info_msg "Starting system log daemon..."
  33. parms=${SYSKLOGD_PARMS-'-m 0'}
  34. start_daemon /sbin/syslogd $parms
  35. evaluate_retval
  36. log_info_msg "Starting kernel log daemon..."
  37. start_daemon /sbin/klogd
  38. evaluate_retval
  39. ;;
  40. stop)
  41. log_info_msg "Stopping kernel log daemon..."
  42. killproc /sbin/klogd
  43. evaluate_retval
  44. log_info_msg "Stopping system log daemon..."
  45. killproc /sbin/syslogd
  46. evaluate_retval
  47. ;;
  48. reload)
  49. log_info_msg "Reloading system log daemon config file..."
  50. pid=`pidofproc syslogd`
  51. kill -HUP "${pid}"
  52. evaluate_retval
  53. ;;
  54. restart)
  55. ${0} stop
  56. sleep 1
  57. ${0} start
  58. ;;
  59. status)
  60. statusproc /sbin/syslogd
  61. statusproc klogd
  62. ;;
  63. *)
  64. echo "Usage: ${0} {start|stop|reload|restart|status}"
  65. exit 1
  66. ;;
  67. esac
  68. exit 0
  69. # End sysklogd