syslogd.init 549 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #PKG busybox
  3. #INIT 05
  4. . /etc/rc.conf
  5. case $1 in
  6. autostop) ;;
  7. autostart)
  8. test x"${syslogd:-NO}" = x"NO" && exit 0
  9. test x"$syslogd" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
  10. exec sh $0 start
  11. ;;
  12. start)
  13. /sbin/syslogd $syslogd_flags
  14. if [ -f /proc/sys/kernel/printk ];then
  15. /sbin/klogd
  16. fi
  17. ;;
  18. stop)
  19. if [ -f /proc/sys/kernel/printk ];then
  20. kill $(pgrep -f /sbin/klogd)
  21. fi
  22. kill $(pgrep -f /sbin/syslogd)
  23. ;;
  24. restart)
  25. sh $0 stop
  26. sh $0 start
  27. ;;
  28. *)
  29. echo "Usage: $0 {start | stop | restart}"
  30. exit 1
  31. ;;
  32. esac
  33. exit $?