summaryrefslogtreecommitdiff
path: root/recipes-extended/rsyslog/rsyslog
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/rsyslog/rsyslog')
-rw-r--r--recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch32
-rw-r--r--recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch46
-rw-r--r--recipes-extended/rsyslog/rsyslog/initscript118
-rw-r--r--recipes-extended/rsyslog/rsyslog/rsyslog.conf91
-rw-r--r--recipes-extended/rsyslog/rsyslog/rsyslog.logrotate39
-rw-r--r--recipes-extended/rsyslog/rsyslog/rsyslog.service21
-rw-r--r--recipes-extended/rsyslog/rsyslog/run-ptest12
-rw-r--r--recipes-extended/rsyslog/rsyslog/use-pkgconfig-to-check-libgcrypt.patch43
8 files changed, 402 insertions, 0 deletions
diff --git a/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch b/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch
new file mode 100644
index 0000000..6ce8b7a
--- /dev/null
+++ b/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch
@@ -0,0 +1,32 @@
+From 7baf35b88d742032a2dc456c396843e17e866f8e Mon Sep 17 00:00:00 2001
+From: Ming Liu <peter.x.liu@external.atlascopco.com>
+Date: Wed, 27 Jun 2018 14:04:57 +0800
+Subject: [PATCH] Include sys/time.h
+
+struct timeval is defined in sys/time.h with a musl libc.
+
+Upstream-Status: Inappropriate [musl libc specific]
+
+Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ tests/msleep.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/tests/msleep.c b/tests/msleep.c
+index 98dbece..96f6950 100644
+--- a/tests/msleep.c
++++ b/tests/msleep.c
+@@ -26,11 +26,7 @@
+ #include "config.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+-#if defined(__FreeBSD__)
+ #include <sys/time.h>
+-#else
+-#include <time.h>
+-#endif
+ #if defined(HAVE_SYS_SELECT_H)
+ #include <sys/select.h>
+ #endif
+2.7.4
diff --git a/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch b/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch
new file mode 100644
index 0000000..552172d
--- /dev/null
+++ b/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch
@@ -0,0 +1,46 @@
+From 194e199ce08acc2192f6a63420ff24d9064666e5 Mon Sep 17 00:00:00 2001
+From: Yi Fan Yu <yifan.yu@windriver.com>
+Date: Sat, 27 Mar 2021 19:18:25 -0400
+Subject: [PATCH] tests: disable the check for inotify
+
+We don't need to check inotify.h.
+Assume it is present since it is part of the linux kernel
+since 2.6.13 [1].
+
+[1](https://kernelnewbies.org/Linux_2_6_13)
+
+(it would require installing the libc headers otherwise,
+ for the test to detect /usr/include/sys/inotify.h.)
+
+Upstream-Status: Inappropriate[OE-specific]
+
+Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
+---
+ tests/diag.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/diag.sh b/tests/diag.sh
+index 6cd60ea88..7424f48c5 100755
+--- a/tests/diag.sh
++++ b/tests/diag.sh
+@@ -2672,7 +2672,7 @@ case $1 in
+ fi
+ ;;
+ 'check-inotify') # Check for inotify/fen support
+- if [ -n "$(find /usr/include -name 'inotify.h' -print -quit)" ]; then
++ if true; then
+ echo [inotify mode]
+ elif [ -n "$(find /usr/include/sys/ -name 'port.h' -print -quit)" ]; then
+ grep -qF "PORT_SOURCE_FILE" < /usr/include/sys/port.h
+@@ -2687,7 +2687,7 @@ case $1 in
+ fi
+ ;;
+ 'check-inotify-only') # Check for ONLY inotify support
+- if [ -n "$(find /usr/include -name 'inotify.h' -print -quit)" ]; then
++ if true; then
+ echo [inotify mode]
+ else
+ echo [inotify not supported, skipping...]
+--
+2.29.2
+
diff --git a/recipes-extended/rsyslog/rsyslog/initscript b/recipes-extended/rsyslog/rsyslog/initscript
new file mode 100644
index 0000000..7a8f8f9
--- /dev/null
+++ b/recipes-extended/rsyslog/rsyslog/initscript
@@ -0,0 +1,118 @@
+#! /bin/sh
+#
+# This is an init script for openembedded
+# Copy it to /etc/init.d/rsyslog and type
+# > update-rc.d rsyslog defaults 5
+#
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+NAME=rsyslog
+RSYSLOGD=rsyslogd
+RSYSLOGD_BIN=/usr/sbin/rsyslogd
+RSYSLOGD_OPTIONS=""
+RSYSLOGD_PIDFILE=/var/run/rsyslogd.pid
+SCRIPTNAME=/etc/init.d/$NAME
+# Exit if the package is not installed
+[ -x "$RSYSLOGD_BIN" ] || exit 0
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+ DAEMON=$1
+ DAEMON_ARGS=$2
+ PIDFILE=$3
+ # Return
+ # 0 if daemon has been started
+ # 1 if daemon could not be started
+ # if daemon had already been started, start-stop-daemon will return 1
+ # so add -o/--oknodo(if nothing is done, exit 0)
+ start-stop-daemon -S --quiet --pidfile $PIDFILE --exec $DAEMON \
+ --oknodo -- $DAEMON_ARGS || return 1
+}
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+ NAME=$1
+ PIDFILE=$2
+ # Return
+ # 0 if daemon has been stopped
+ # 1 if daemon was already stopped
+ # 2 if daemon could not be stopped
+ # other if a failure occurred
+ # QUIT/TERM/INT should work here, but they don't ?????
+ start-stop-daemon -K --quiet --signal KILL --pidfile $PIDFILE --name $NAME
+ RETVAL="$?"
+ rm -f $PIDFILE
+ return "$RETVAL"
+}
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+ NAME=$1
+ PIDFILE=$2
+ start-stop-daemon -K --signal HUP --quiet --pidfile $PIDFILE --name $NAME
+ return 0
+}
+
+do_status() {
+ NAME=$1
+ PIDFILE=$2
+ # -t: test only but not stop
+ start-stop-daemon -K -t --quiet --pidfile $PIDFILE --name $NAME
+ # exit with status 0 if process is found
+ if [ "$?" = "0" ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+case "$1" in
+ start)
+ echo -n "starting $RSYSLOGD ... "
+ do_start "$RSYSLOGD_BIN" "$RSYSLOGD_OPTIONS" "$RSYSLOGD_PIDFILE"
+ case "$?" in
+ 0) echo "done" ;;
+ 1) echo "failed" ;;
+ esac
+ ;;
+ stop)
+ echo -n "stopping $RSYSLOGD ... "
+ do_stop "$RSYSLOGD" "$RSYSLOGD_PIDFILE"
+ case "$?" in
+ 0|1) echo "done" ;;
+ 2) echo "failed" ;;
+ esac
+ ;;
+ reload|force-reload)
+ echo -n "reloading $RSYSLOGD ... "
+ do_reload "$RSYSLOGD" "$RSYSLOGD_PIDFILE"
+ echo "done"
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ echo -n "status $RSYSLOGD ... "
+ do_status "$RSYSLOGD" "$RSYSLOGD_PIDFILE"
+ if [ "$?" = "0" ]; then
+ echo "running"
+ exit 0
+ else
+ echo "stopped"
+ exit 1
+ fi
+ ;;
+ *)
+ echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload|force-reload}" >&2
+ exit 3
+ ;;
+esac
+exit 0
diff --git a/recipes-extended/rsyslog/rsyslog/rsyslog.conf b/recipes-extended/rsyslog/rsyslog/rsyslog.conf
new file mode 100644
index 0000000..dbfefb7
--- /dev/null
+++ b/recipes-extended/rsyslog/rsyslog/rsyslog.conf
@@ -0,0 +1,91 @@
+# if you experience problems, check
+# http://www.rsyslog.com/troubleshoot for assistance
+
+# rsyslog v3: load input modules
+# If you do not load inputs, nothing happens!
+# You may need to set the module load path if modules are not found.
+#
+# Ported from debian's sysklogd.conf
+
+$ModLoad immark # provides --MARK-- message capability
+$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
+$ModLoad imklog # kernel logging (formerly provided by rklogd)
+
+#
+# Set the default permissions
+#
+$FileOwner root
+$FileGroup adm
+$FileCreateMode 0640
+$DirCreateMode 0755
+$Umask 0022
+
+auth,authpriv.* /var/log/auth.log
+*.*;auth,authpriv.none -/var/log/syslog
+cron.* /var/log/cron.log
+daemon.* -/var/log/daemon.log
+kern.* -/var/log/kern.log
+lpr.* -/var/log/lpr.log
+mail.* -/var/log/mail.log
+user.* -/var/log/user.log
+
+#
+# Logging for the mail system. Split it up so that
+# it is easy to write scripts to parse these files.
+#
+mail.info -/var/log/mail.info
+mail.warn -/var/log/mail.warn
+mail.err /var/log/mail.err
+
+# Logging for INN news system
+#
+news.crit /var/log/news.crit
+news.err /var/log/news.err
+news.notice -/var/log/news.notice
+
+#
+# Some `catch-all' logfiles.
+#
+*.=debug;\
+ auth,authpriv.none;\
+ news.none;mail.none -/var/log/debug
+*.=info;*.=notice;*.=warn;\
+ auth,authpriv.none;\
+ cron,daemon.none;\
+ mail,news.none -/var/log/messages
+
+#
+# Emergencies are sent to everybody logged in.
+#
+*.emerg :omusrmsg:*
+
+# Save boot messages also to boot.log
+local7.* /var/log/boot.log
+
+# Remote Logging (we use TCP for reliable delivery)
+# An on-disk queue is created for this action. If the remote host is
+# down, messages are spooled to disk and sent when it is up again.
+#$WorkDirectory /var/spool/rsyslog # where to place spool files
+#$ActionQueueFileName uniqName # unique name prefix for spool files
+$ActionQueueMaxDiskSpace 10m # 1gb space limit (use as much as possible)
+#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
+#$ActionQueueType LinkedList # run asynchronously
+#$ActionResumeRetryCount -1 # infinite retries if host is down
+# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
+#*.* @@remote-host:514
+
+
+# ######### Receiving Messages from Remote Hosts ##########
+# TCP Syslog Server:
+# provides TCP syslog reception and GSS-API (if compiled to support it)
+#$ModLoad imtcp.so # load module
+#$InputTCPServerRun 514 # start up TCP listener at port 514
+
+# UDP Syslog Server:
+#$ModLoad imudp.so # provides UDP syslog reception
+#$UDPServerRun 514 # start a UDP syslog server at standard port 514
+
+#
+# Include all config files in /etc/rsyslog.d/
+#
+$IncludeConfig /etc/rsyslog.d/*.conf
diff --git a/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate b/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate
new file mode 100644
index 0000000..5f8568f
--- /dev/null
+++ b/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate
@@ -0,0 +1,39 @@
+# /etc/logrotate.d/rsyslog - Ported from Debian
+
+/var/log/syslog
+{
+ rotate 7
+ daily
+ missingok
+ notifempty
+ delaycompress
+ compress
+ postrotate
+ @BINDIR@/pkill -HUP rsyslogd 2> /dev/null || true
+ endscript
+}
+
+/var/log/mail.info
+/var/log/mail.warn
+/var/log/mail.err
+/var/log/mail.log
+/var/log/daemon.log
+/var/log/kern.log
+/var/log/auth.log
+/var/log/user.log
+/var/log/lpr.log
+/var/log/cron.log
+/var/log/debug
+/var/log/messages
+{
+ rotate 4
+ weekly
+ missingok
+ notifempty
+ compress
+ delaycompress
+ sharedscripts
+ postrotate
+ @BINDIR@/pkill -HUP rsyslogd 2> /dev/null || true
+ endscript
+}
diff --git a/recipes-extended/rsyslog/rsyslog/rsyslog.service b/recipes-extended/rsyslog/rsyslog/rsyslog.service
new file mode 100644
index 0000000..0aacff3
--- /dev/null
+++ b/recipes-extended/rsyslog/rsyslog/rsyslog.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=System Logging Service
+Requires=syslog.socket
+Wants=network.target network-online.target
+After=network.target network-online.target
+Documentation=man:rsyslogd(8)
+Documentation=http://www.rsyslog.com/doc/
+
+[Service]
+Type=notify
+ExecStart=@sbindir@/rsyslogd -n -iNONE
+StandardOutput=null
+Restart=on-failure
+
+# Increase the default a bit in order to allow many simultaneous
+# files to be monitored, we might need a lot of fds.
+LimitNOFILE=16384
+
+[Install]
+WantedBy=multi-user.target
+Alias=syslog.service
diff --git a/recipes-extended/rsyslog/rsyslog/run-ptest b/recipes-extended/rsyslog/rsyslog/run-ptest
new file mode 100644
index 0000000..efa9ba3
--- /dev/null
+++ b/recipes-extended/rsyslog/rsyslog/run-ptest
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+set -e
+set -o pipefail
+
+SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
+cd ${SCRIPTPATH}
+useradd tester || echo "user already exists"
+ln -sf /usr/sbin/logrotate /usr/bin/logrotate
+su tester -c "make -C tests -k check-TESTS"
+userdel tester
+rm -f /usr/bin/logrotate
diff --git a/recipes-extended/rsyslog/rsyslog/use-pkgconfig-to-check-libgcrypt.patch b/recipes-extended/rsyslog/rsyslog/use-pkgconfig-to-check-libgcrypt.patch
new file mode 100644
index 0000000..0352587
--- /dev/null
+++ b/recipes-extended/rsyslog/rsyslog/use-pkgconfig-to-check-libgcrypt.patch
@@ -0,0 +1,43 @@
+From d0852006bf3d305e8984b85b41997d43d4476937 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Wed, 18 Jun 2014 13:46:52 +0800
+Subject: [PATCH] use pkgconfig to check libgcrypt
+
+Upstream-Status: Inappropriate [configuration]
+
+libgcrypt does no longer provide libgcrypt-config, and provide
+*.pc, so we should use pkgconfig to check
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+---
+ configure.ac | 15 +--------------
+ 1 file changed, 1 insertion(+), 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 62178c3..b56c9c7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -889,20 +889,7 @@ AC_ARG_ENABLE(libgcrypt,
+ [enable_libgcrypt=yes]
+ )
+ if test "x$enable_libgcrypt" = "xyes"; then
+- AC_PATH_PROG([LIBGCRYPT_CONFIG],[libgcrypt-config],[no])
+- if test "x${LIBGCRYPT_CONFIG}" = "xno"; then
+- AC_MSG_FAILURE([libgcrypt-config not found in PATH])
+- fi
+- AC_CHECK_LIB(
+- [gcrypt],
+- [gcry_cipher_open],
+- [LIBGCRYPT_CFLAGS="`${LIBGCRYPT_CONFIG} --cflags`"
+- LIBGCRYPT_LIBS="`${LIBGCRYPT_CONFIG} --libs`"
+- ],
+- [AC_MSG_FAILURE([libgcrypt is missing])],
+- [`${LIBGCRYPT_CONFIG} --libs --cflags`]
+- )
+- AC_DEFINE([ENABLE_LIBGCRYPT], [1], [Indicator that LIBGCRYPT is present])
++ PKG_CHECK_MODULES(LIBGCRYPT, libgcrypt)
+ fi
+ AM_CONDITIONAL(ENABLE_LIBGCRYPT, test x$enable_libgcrypt = xyes)
+ AC_SUBST(LIBGCRYPT_CFLAGS)