sysklogd.xml 1.5 KB

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