summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/files/syslog
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-core/busybox/files/syslog
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadpoky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-core/busybox/files/syslog')
-rw-r--r--meta/recipes-core/busybox/files/syslog74
1 files changed, 74 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/files/syslog b/meta/recipes-core/busybox/files/syslog
new file mode 100644
index 0000000000..9edaa15053
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog
@@ -0,0 +1,74 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: sysklogd
4# Required-Start: $remote_fs $time
5# Required-Stop: $remote_fs $time
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: System logger
9### END INIT INFO
10
11set -e
12
13if [ -f /etc/syslog.conf ]; then
14 . /etc/syslog.conf
15 LOG_LOCAL=0
16 LOG_REMOTE=0
17 for D in $DESTINATION; do
18 if [ "$D" = "buffer" ]; then
19 SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
20 LOG_LOCAL=1
21 elif [ "$D" = "file" ]; then
22 if [ -n "$LOGFILE" ]; then
23 SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
24 fi
25 if [ -n "$ROTATESIZE" ]; then
26 SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
27 fi
28 if [ -n "$ROTATEGENS" ]; then
29 SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
30 fi
31 LOCAL=0
32 elif [ "$D" = "remote" ]; then
33 SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
34 LOG_REMOTE=1
35 fi
36 done
37 if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
38 SYSLOG_ARGS="$SYSLOG_ARGS -L"
39 fi
40 if [ -n "$MARKINT" ]; then
41 SYSLOG_ARGS="$SYSLOG_ARGS -m $MARKINT"
42 fi
43 if [ "$REDUCE" = "yes" ]; then
44 SYSLOG_ARGS="$SYSLOG_ARGS -S"
45 fi
46else
47 # default: log to 16K shm circular buffer
48 SYSLOG_ARGS="-C"
49fi
50
51case "$1" in
52 start)
53 echo -n "Starting syslogd/klogd: "
54 start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
55 start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
56 echo "done"
57 ;;
58 stop)
59 echo -n "Stopping syslogd/klogd: "
60 start-stop-daemon -K -n syslogd
61 start-stop-daemon -K -n klogd
62 echo "done"
63 ;;
64 restart)
65 $0 stop
66 $0 start
67 ;;
68 *)
69 echo "Usage: syslog { start | stop | restart }" >&2
70 exit 1
71 ;;
72esac
73
74exit 0