sysklogd.xml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <sect1 id="ch07-sysklogd">
  2. <title>Creating the sysklogd script</title>
  3. <para>Create the <filename>/etc/init.d/sysklogd</filename> script by running
  4. the following command:</para>
  5. <para><screen><userinput>cat &gt; /etc/init.d/sysklogd &lt;&lt; "EOF"</userinput>
  6. #!/bin/sh
  7. # Begin /etc/init.d/sysklogd
  8. #
  9. # Include the functions declared in the /etc/init.d/functions file
  10. #
  11. source /etc/init.d/functions
  12. case "$1" in
  13. start)
  14. echo -n "Starting system log daemon..."
  15. loadproc /usr/sbin/syslogd -m 0
  16. echo -n "Starting kernel log daemon..."
  17. loadproc /usr/sbin/klogd
  18. ;;
  19. stop)
  20. echo -n "Stopping kernel log daemon..."
  21. killproc klogd
  22. echo -n "Stopping system log daemon..."
  23. killproc syslogd
  24. ;;
  25. reload)
  26. echo -n "Reloading system log daemon configuration file..."
  27. reloadproc syslogd 1
  28. ;;
  29. restart)
  30. $0 stop
  31. /usr/bin/sleep 1
  32. $0 start
  33. ;;
  34. status)
  35. statusproc /usr/sbin/syslogd
  36. statusproc /usr/sbin/klogd
  37. ;;
  38. *)
  39. echo "Usage: $0 {start|stop|reload|restart|status}"
  40. exit 1
  41. ;;
  42. esac
  43. # End /etc/init.d/sysklogd
  44. <userinput>EOF</userinput></screen></para>
  45. </sect1>