1
0

syslogd.init 478 B

123456789101112131415161718192021222324252627282930313233
  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_flags:-NO}" = x"NO" && exit 0
  9. exec sh $0 start
  10. ;;
  11. start)
  12. /sbin/syslogd $syslogd_flags
  13. if [ -f /proc/sys/kernel/printk ];then
  14. /sbin/klogd
  15. fi
  16. ;;
  17. stop)
  18. if [ -f /proc/sys/kernel/printk ];then
  19. kill $(pgrep -f /sbin/klogd)
  20. fi
  21. kill $(pgrep -f /sbin/syslogd)
  22. ;;
  23. restart)
  24. sh $0 stop
  25. sh $0 start
  26. ;;
  27. *)
  28. echo "Usage: $0 {start | stop | restart}"
  29. exit 1
  30. ;;
  31. esac
  32. exit $?