diff options
Diffstat (limited to 'app-admin/sysklogd/files')
-rw-r--r-- | app-admin/sysklogd/files/sysklogd-2.0.3-no_parallel_build.patch | 40 | ||||
-rw-r--r-- | app-admin/sysklogd/files/sysklogd.confd2 | 6 | ||||
-rw-r--r-- | app-admin/sysklogd/files/sysklogd.rc8 | 94 | ||||
-rw-r--r-- | app-admin/sysklogd/files/sysklogd.rc9 | 82 |
4 files changed, 222 insertions, 0 deletions
diff --git a/app-admin/sysklogd/files/sysklogd-2.0.3-no_parallel_build.patch b/app-admin/sysklogd/files/sysklogd-2.0.3-no_parallel_build.patch new file mode 100644 index 000000000000..fa0f96ce2c81 --- /dev/null +++ b/app-admin/sysklogd/files/sysklogd-2.0.3-no_parallel_build.patch @@ -0,0 +1,40 @@ +From 9cf1f97cef04fed81c2407f7207795d7592ccb96 Mon Sep 17 00:00:00 2001 +From: Joachim Nilsson <troglobit@gmail.com> +Date: Fri, 6 Dec 2019 18:19:05 +0100 +Subject: [PATCH] Fix nasty parallel build problem reported by Gentoo and + Westermo + +Independently of each other both the Gentoo project and Westermo found +an issue with massively parallel builds on monster-core-machines. At +Westermo there are 40 core Xeon monsters that stumble when building +sysklogd. + +The Gentoo bug report is here: + + https://bugs.gentoo.org/701894 + +The problem stems from strlcat.c and strlcpy.c being used for both +the libcompat convenience library built for libsyslog and als for +syslogd when the system does not have either of the APIs in libc, +i.e. most Linux systems with GLIBC or musl libc. + +I can either rewrite the Makefile.am files to handle dependencies +better, or we just disable parallel build like this patch. There's +too few source files to gain anything from parallel build anyway. + +Signed-off-by: Joachim Nilsson <troglobit@gmail.com> +--- + Makefile.am | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/Makefile.am b/Makefile.am +index c4cc80f..7e2b854 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -46,3 +46,6 @@ release: distcheck + # Workaround for systemd unit file duing distcheck + DISTCHECK_CONFIGURE_FLAGS = --with-systemd=$$dc_install_base/$(systemd) --with-klogd + ++# Disable parallel build in top Makefile, we might otherwise get a very ++# bizarre build problem with strlcpy.o in libcompat and for syslogd. ++.NOTPARALLEL: diff --git a/app-admin/sysklogd/files/sysklogd.confd2 b/app-admin/sysklogd/files/sysklogd.confd2 new file mode 100644 index 000000000000..077f36bf6b64 --- /dev/null +++ b/app-admin/sysklogd/files/sysklogd.confd2 @@ -0,0 +1,6 @@ +# Config file for /etc/init.d/sysklogd + +SYSLOGD="-m 0 -s -s -r 10M:10" +# send warnings and above to the console +KLOGD="-c 3 -2" + diff --git a/app-admin/sysklogd/files/sysklogd.rc8 b/app-admin/sysklogd/files/sysklogd.rc8 new file mode 100644 index 000000000000..920ab9633264 --- /dev/null +++ b/app-admin/sysklogd/files/sysklogd.rc8 @@ -0,0 +1,94 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +extra_started_commands="reload" + +depend() { + need clock hostname + provide logger +} + +has_klogd() { + [ -x "/usr/sbin/klogd" ] +} + +start_daemon() { + local retval=0 + local daemon="$1" + local options="$2" + local fg_opt="" + + case "${daemon}" in + syslogd) + fg_opt="-F" + ;; + klogd) + fgopt="-n" + ;; + *) + return 1 + ;; + esac + + ebegin "sysklogd -> start: ${daemon}" + start-stop-daemon --start --exec /usr/sbin/"${daemon}" \ + -b -m --pidfile /var/run/"${daemon}".pid \ + -- ${options} ${fg_opt} + retval=$? + eend ${retval} "Failed to start ${daemon}" + + return ${retval} +} + +stop_daemon() { + local retval=0 + local daemon="$1" + + [ -z "${daemon}" ] && return 1 + + ebegin "sysklogd -> stop: ${daemon}" + # syslogd can be stubborn some times (--retry 15)... + start-stop-daemon --stop --retry 15 --quiet --pidfile /var/run/"${daemon}".pid + retval=$? + eend ${retval} "Failed to stop ${daemon}" + + return ${retval} +} + +start() { + start_daemon "syslogd" "${SYSLOGD}" || return 1 + + # klogd do not always start proper if started too early + sleep 1 + + if has_klogd && ! start_daemon "klogd" "${KLOGD}" ; then + stop_daemon "syslogd" + return 1 + fi + + return 0 +} + +stop() { + if has_klogd ; then + stop_daemon "klogd" || return 1 + fi + stop_daemon "syslogd" || return 1 + return 0 +} + +reload() { + local ret=0 + + ebegin "Reloading configuration" + + start-stop-daemon --signal HUP --pidfile /var/run/syslogd.pid + ret=$((${ret} + $?)) + if has_klogd ; then + start-stop-daemon --signal USR1 --pidfile /var/run/klogd.pid + ret=$((${ret} + $?)) + fi + + eend ${ret} +} diff --git a/app-admin/sysklogd/files/sysklogd.rc9 b/app-admin/sysklogd/files/sysklogd.rc9 new file mode 100644 index 000000000000..b0479f1c1754 --- /dev/null +++ b/app-admin/sysklogd/files/sysklogd.rc9 @@ -0,0 +1,82 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +extra_started_commands="reload" + +depend() { + need clock hostname + provide logger +} + +has_klogd() { + [ -x "/usr/sbin/klogd" ] +} + +start_daemon() { + local retval=0 + local daemon="$1" + local options="$2" + local fg_opt="" + + ebegin "sysklogd -> start: ${daemon}" + start-stop-daemon --start --exec /usr/sbin/"${daemon}" \ + -b -m --pidfile /var/run/"${daemon}".pid \ + -- -F ${options} + retval=$? + eend ${retval} "Failed to start ${daemon}" + + return ${retval} +} + +stop_daemon() { + local retval=0 + local daemon="$1" + + [ -z "${daemon}" ] && return 1 + + ebegin "sysklogd -> stop: ${daemon}" + # syslogd can be stubborn some times (--retry 15)... + start-stop-daemon --stop --retry 15 --quiet --pidfile /var/run/"${daemon}".pid + retval=$? + eend ${retval} "Failed to stop ${daemon}" + + return ${retval} +} + +start() { + start_daemon "syslogd" "${SYSLOGD}" || return 1 + + # klogd do not always start proper if started too early + sleep 1 + + if has_klogd && ! start_daemon "klogd" "${KLOGD}" ; then + stop_daemon "syslogd" + return 1 + fi + + return 0 +} + +stop() { + if has_klogd ; then + stop_daemon "klogd" || return 1 + fi + stop_daemon "syslogd" || return 1 + return 0 +} + +reload() { + local ret=0 + + ebegin "Reloading configuration" + + start-stop-daemon --signal HUP --pidfile /var/run/syslogd.pid + ret=$((${ret} + $?)) + if has_klogd ; then + start-stop-daemon --signal USR1 --pidfile /var/run/klogd.pid + ret=$((${ret} + $?)) + fi + + eend ${ret} +} |