no more support for chroot-based packaging
[myplc.git] / plc.d / syslog
1 #!/bin/bash
2 #
3 # priority: 200
4 #
5 # Do not use the standard syslog initscript. It will start up a
6 # (probably duplicate) copy of klogd, and on shutdown, if a pidfile is
7 # not found, will (probably) kill the host syslogd and klogd instances
8 # as well.
9 #
10 # Mark Huang <mlhuang@cs.princeton.edu>
11 # Copyright (C) 2006 The Trustees of Princeton University
12 #
13 # $Id$
14 #
15
16 # Source function library and configuration
17 . /etc/plc.d/functions
18 . /etc/planetlab/plc_config
19
20 # Be verbose
21 set -x
22
23 # fedora 8 comes with a new name for the binary
24 if type rsyslogd &> /dev/null ; then
25     syslogname=rsyslogd
26 else
27     syslogname=syslogd
28 fi
29
30 case "$1" in
31     start)
32         MESSAGE=$"Starting system logger"
33         dialog "$MESSAGE"
34
35         plc_daemon $syslogname -m 0
36         check
37
38         result "$MESSAGE"
39         ;;
40
41     stop)
42         MESSAGE=$"Shutting down system logger"
43         dialog "$MESSAGE"
44
45         killproc plc_$syslogname
46         check
47
48         result "$MESSAGE"
49         ;;
50 esac
51
52 exit $ERRORS