aboutsummaryrefslogtreecommitdiff
path: root/trunk/templates/vserver-legacy/vserver-legacy.d/etc/rc.d/rc.syslog
blob: a005fb75d5a35197d3cc19930c095627bda1b30f (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
#!/bin/sh
# Start/stop/restart the system logging daemons.
#
# Written for Slackware Linux by Patrick J. Volkerding <volkerdi@slackware.com>.

syslogd_start() {
  if [ -x /usr/sbin/syslogd -a -x /usr/sbin/klogd ]; then
    echo -n "Starting sysklogd daemons: "
    echo -n "/usr/sbin/syslogd "
    /usr/sbin/syslogd
    sleep 1 # prevent syslogd/klogd race condition on SMP kernels
    echo "/usr/sbin/klogd -c 3 -x"
    # '-c 3' = display level 'error' or higher messages on console
    # '-x' = turn off broken EIP translation
    /usr/sbin/klogd -c 3 -x
  fi
}

syslogd_stop() {
  killall syslogd 2> /dev/null
  killall klogd 2> /dev/null
}

syslogd_restart() {
  syslogd_stop
  sleep 1
  syslogd_start
}

case "$1" in
'start')
  syslogd_start
  ;;
'stop')
  syslogd_stop
  ;;
'restart')
  syslogd_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac