summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild3
-rw-r--r--src/etc/init.d/syslog30
2 files changed, 32 insertions, 1 deletions
diff --git a/build b/build
index 177e6c0..d41f2e5 100755
--- a/build
+++ b/build
@@ -40,7 +40,8 @@ basefiles.buildstamp:
ln -s ../init.d/sysfs etc/rc.d/S01sysfs && \
ln -s ../init.d/mdev etc/rc.d/S02mdev && \
ln -s ../init.d/mountall etc/rc.d/S03mountall && \
- ln -s ../init.d/networking etc/rc.d/S04networking
+ ln -s ../init.d/networking etc/rc.d/S04networking && \
+ ln -s ../init.d/syslog etc/rc.d/S05syslog
oh-installfiles $(PKGS)
oh-installdocs basefiles
oh-gencontrol $(PKGS)
diff --git a/src/etc/init.d/syslog b/src/etc/init.d/syslog
new file mode 100644
index 0000000..4979ce6
--- /dev/null
+++ b/src/etc/init.d/syslog
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+SYSLOG_ROTATE_SIZE=65536
+
+case "${1}" in
+ start)
+ printf 'Starting syslog... '
+ start-stop-daemon -S syslogd -m 0 -s "${SYSLOG_ROTATE_SIZE}" -L
+ printf 'done.'
+ printf 'Starting klogd... '
+ start-stop-daemon -S klogd
+ printf 'done.'
+ ;;
+ stop)
+ printf 'Stopping klogd... '
+ start-stop-daemon -K klogd
+ printf 'done.'
+ printf 'Stopping syslog... '
+ start-stop-daemon -K syslogd
+ printf 'done.'
+ ;;
+ restart)
+ "${0}" stop
+ "${0}" start
+ ;;
+ *)
+ printf 'Usage: %s {start|stop|restart}\n' "${0}"
+ exit 1
+ ;;
+esac