Add support for the full blown versions of sysklogd and klogd
authorEric Andersen <andersen@codepoet.org>
Tue, 13 Sep 2005 20:58:37 +0000 (20:58 -0000)
committerEric Andersen <andersen@codepoet.org>
Tue, 13 Sep 2005 20:58:37 +0000 (20:58 -0000)
package/Config.in
package/sysklogd/Config.in [new file with mode: 0644]
package/sysklogd/init-syslog [new file with mode: 0755]
package/sysklogd/sysklogd.mk [new file with mode: 0644]
package/sysklogd/sysklogd.patch [new file with mode: 0644]
package/sysklogd/syslog.conf [new file with mode: 0644]

index 588abdc0efcecf50ed9d7cf432778106129836cc..ab0e15b85db07ffbe14d97f110e24ce62e212aea 100644 (file)
@@ -102,6 +102,7 @@ source "package/sfdisk/Config.in"
 source "package/slang/Config.in"
 source "package/socat/Config.in"
 source "package/strace/Config.in"
+source "package/sysklogd/Config.in"
 source "package/tcl/Config.in"
 source "package/tcpdump/Config.in"
 source "package/tftpd/Config.in"
diff --git a/package/sysklogd/Config.in b/package/sysklogd/Config.in
new file mode 100644 (file)
index 0000000..369a98f
--- /dev/null
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_SYSKLOGD
+       bool "syslogd & klogd"
+       default n
+       help
+         System log daemons syslogd and klogd.
+
+         http://www.infodrom.org/products/sysklogd/
diff --git a/package/sysklogd/init-syslog b/package/sysklogd/init-syslog
new file mode 100755 (executable)
index 0000000..07683ed
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Starts syslog.
+#
+
+
+
+umask 077
+
+start() {
+       echo -n "Starting syslogd: "
+       start-stop-daemon --start --quiet --pidfile /var/run/syslog.pid --exec /sbin/syslogd -- -m 0
+       echo "OK"
+
+       echo -n "Starting klogd: "
+       start-stop-daemon --start --quiet --pidfile /var/run/klogd.pid --exec /sbin/klogd
+       echo "OK"
+}
+stop() {
+       echo -n "Stopping klogd: "
+       start-stop-daemon --stop --name klogd
+       echo "OK"
+
+       echo -n "Stopping syslogd: "
+       start-stop-daemon --stop --name syslogd
+       echo "OK"
+}
+restart() {
+       stop
+       start
+}
+
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart|reload)
+       restart
+       ;;
+  *)
+       echo $"Usage: $0 {start|stop|restart}"
+       exit 1
+esac
+
+exit $?
diff --git a/package/sysklogd/sysklogd.mk b/package/sysklogd/sysklogd.mk
new file mode 100644 (file)
index 0000000..9f18eb8
--- /dev/null
@@ -0,0 +1,57 @@
+#############################################################
+#
+# sysklogd
+#
+#############################################################
+SYSKLOGD_VER:=1.4.1
+SYSKLOGD_SOURCE:=sysklogd-$(SYSKLOGD_VER).tar.gz
+SYSKLOGD_SITE:=http://www.infodrom.org/projects/sysklogd/download
+SYSKLOGD_DIR:=$(BUILD_DIR)/sysklogd-$(SYSKLOGD_VER)
+SYSKLOGD_SYSLOGD_BINARY:=syslogd
+SYSKLOGD_KLOGD_BINARY:=klogd
+SYSKLOGD_BINARY:=$(SYSKLOGD_KLOGD_BINARY)
+SYSKLOGD_SYSLOGD_TARGET_BINARY:=sbin/syslogd
+SYSKLOGD_KLOGD_TARGET_BINARY:=sbin/klogd
+SYSKLOGD_TARGET_BINARY:=$(SYSKLOGD_KLOGD_TARGET_BINARY)
+
+$(DL_DIR)/$(SYSKLOGD_SOURCE):
+        $(WGET) -P $(DL_DIR) $(SYSKLOGD_SITE)/$(SYSKLOGD_SOURCE)
+
+sysklogd-source: $(DL_DIR)/$(SYSKLOGD_SOURCE)
+
+$(SYSKLOGD_DIR)/.unpacked: $(DL_DIR)/$(SYSKLOGD_SOURCE)
+       zcat $(DL_DIR)/$(SYSKLOGD_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+       toolchain/patch-kernel.sh $(SYSKLOGD_DIR) package/sysklogd/ sysklogd\*.patch
+       touch $(SYSKLOGD_DIR)/.unpacked
+
+$(SYSKLOGD_DIR)/$(SYSKLOGD_BINARY): $(SYSKLOGD_DIR)/.unpacked
+       $(MAKE) CC=$(TARGET_CC) -C $(SYSKLOGD_DIR)
+       $(STRIP) $(SYSKLOGD_DIR)/$(SYSKLOGD_SYSLOGD_BINARY)
+       $(STRIP) $(SYSKLOGD_DIR)/$(SYSKLOGD_KLOGD_BINARY)
+
+$(TARGET_DIR)/$(SYSKLOGD_TARGET_BINARY): $(SYSKLOGD_DIR)/$(SYSKLOGD_BINARY)
+       $(INSTALL) -m 0755 -D $(SYSKLOGD_DIR)/$(SYSKLOGD_SYSLOGD_BINARY) $(TARGET_DIR)/$(SYSKLOGD_SYSLOGD_TARGET_BINARY)
+       $(INSTALL) -m 0755 -D $(SYSKLOGD_DIR)/$(SYSKLOGD_KLOGD_BINARY) $(TARGET_DIR)/$(SYSKLOGD_KLOGD_TARGET_BINARY)
+       $(INSTALL) -m 0755 -D package/sysklogd/init-syslog $(TARGET_DIR)/etc/init.d/S25syslog
+       $(INSTALL) -m 0644 -D package/sysklogd/syslog.conf $(TARGET_DIR)/etc/syslog.conf
+
+sysklogd: uclibc $(TARGET_DIR)/$(SYSKLOGD_TARGET_BINARY)
+
+sysklogd-clean:
+       rm -f $(TARGET_DIR)/$(SYSKLOGD_SYSLOGD_TARGET_BINARY)
+       rm -f $(TARGET_DIR)/$(SYSKLOGD_KLOGD_TARGET_BINARY)
+       rm -f $(TARGET_DIR)/etc/init.d/S25syslogd
+       rm -f $(TARGET_DIR)/etc/syslog.conf
+       -$(MAKE) -C $(SYSKLOGD_DIR) clean
+
+sysklogd-dirclean:
+       rm -rf $(SYSKLOGD_DIR)
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_SYSKLOGD)),y)
+TARGETS+=sysklogd
+endif
diff --git a/package/sysklogd/sysklogd.patch b/package/sysklogd/sysklogd.patch
new file mode 100644 (file)
index 0000000..5178ed3
--- /dev/null
@@ -0,0 +1,17 @@
+On MIPS architecture, sysklogd fails to compile because linux/module.h
+depends on asmlinkage, which is defined linux/linkage.h.
+
+The "proper" fix to this would probably be to apply the
+mips-fixed-fls-warning.patch to the linux sources, which patches
+asm-mips/system.h to always include linux/linkage.h.
+
+--- sysklogd-1.4.1/ksym_mod.c.orig     2000-09-12 14:15:28.000000000 -0700
++++ sysklogd-1.4.1/ksym_mod.c  2005-08-15 14:11:42.000000000 -0700
+@@ -89,6 +89,7 @@
+ #include <errno.h>
+ #include <sys/fcntl.h>
+ #include <sys/stat.h>
++#include <linux/linkage.h>
+ #if !defined(__GLIBC__)
+ #include <linux/time.h>
+ #include <linux/module.h>
diff --git a/package/sysklogd/syslog.conf b/package/sysklogd/syslog.conf
new file mode 100644 (file)
index 0000000..3184139
--- /dev/null
@@ -0,0 +1,7 @@
+# /etc/syslog.conf - Configuration file for syslogd
+
+auth,authpriv.*                /var/log/auth.log
+*.*;auth,authpriv.none /var/log/messages
+user.*                 /var/log/user.log
+
+*.emerg                        *