aboutsummaryrefslogtreecommitdiffstats
path: root/chapter07/sysklogd.xml
blob: 4537f0d1ec1d7b8d61fc142df74c8b24bc362841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<sect1 id="ch07-sysklogd">
<title>Creating the sysklogd script</title>

<para>Create the <filename>/etc/init.d/sysklogd</filename> script by running
the following command:</para>

<para><screen><userinput>cat &gt; /etc/init.d/sysklogd &lt;&lt; "EOF"</userinput>
#!/bin/sh
# Begin /etc/init.d/sysklogd

#
# Include the functions declared in the /etc/init.d/functions file
#

source /etc/init.d/functions

case "$1" in
        start)
                echo -n "Starting system log daemon..."
                loadproc /usr/sbin/syslogd -m 0

                echo -n "Starting kernel log daemon..."
                loadproc /usr/sbin/klogd
                ;;

        stop)
                echo -n "Stopping kernel log daemon..."
                killproc klogd

                echo -n "Stopping system log daemon..."
                killproc syslogd
                ;;

        reload)
        echo -n "Reloading system log daemon configuration file..."
                reloadproc syslogd 1
                ;;

        restart)
                $0 stop
                /usr/bin/sleep 1
                $0 start
                ;;

        status)
                statusproc /usr/sbin/syslogd
                statusproc /usr/sbin/klogd
                ;;

        *)
                echo "Usage: $0 {start|stop|reload|restart|status}"
                exit 1
	        ;;

esac

# End /etc/init.d/sysklogd
<userinput>EOF</userinput></screen></para>

</sect1>