busybox: update S01logging
PATCH v2 1/8 busybox: update S01logging
Reformat and fix syslogd/klogd startup script for better quality and code style:
- Detect and report start/stop errors (previous version ignored them and always reported OK).
- Use a separate function for restart.
- Implement reload as restart.
- Support a configuration variable that completely disables the service and issues a warning message on any invocation.
---
Changes v1->v2
- Implement suggestions made by Nicolas Cavallari and Arnout Vandecappelle
--- package/busybox/S01logging | 82 +++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 28 deletions(-)
package/busybox/S01logging +54 -28
@@ -1,40 +1,66 @@ #!/bin/sh -# -# Start logging -# -SYSLOGD_ARGS=-n -KLOGD_ARGS=-n -[ -r /etc/default/logging ] && . /etc/default/logging +DAEMON="logging" +SPIDFILE="/var/run/syslogd.pid" +KPIDFILE="/var/run/klogd.pid" +SYSLOGD_ARGS="" +KLOGD_ARGS="" +ENABLED="yes" + +# shellcheck source=/dev/null +[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" + +if [ "$ENABLED" != "yes" ]; then + printf '%s is disabled\n' "$DAEMON" + exit 0 +fi + +# BusyBox' syslogd and klogd do not create pidfiles, so use "-m" to instruct +# start-stop-daemon to create them. This also means that we must pass "-n" to +# sylogd and klogd in the command line. start() { - printf "Starting logging: " - start-stop-daemon -b -S -q -m -p /var/run/syslogd.pid --exec /sbin/syslogd -- $SYSLOGD_ARGS - start-stop-daemon -b -S -q -m -p /var/run/klogd.pid --exec /sbin/klogd -- $KLOGD_ARGS - echo "OK" + printf 'Starting %s: ' "$DAEMON" + status=0 + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon -b -S -q -m -p "$SPIDFILE" -x /sbin/syslogd -- -n $SYSLOGD_ARGS || status=$? + start-stop-daemon -b -S -q -m -p "$KPIDFILE" -x /sbin/klogd -- -n $KLOGD_ARGS || status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" } stop() { - printf "Stopping logging: " - start-stop-daemon -K -q -p /var/run/syslogd.pid - start-stop-daemon -K -q -p /var/run/klogd.pid - echo "OK" + printf 'Stopping %s: ' "$DAEMON" + status=0 + start-stop-daemon -K -q -p "$SPIDFILE" || status=$? + [ "$status" -eq 0 ] && rm -f "$SPIDFILE" + start-stop-daemon -K -q -p "$KPIDFILE" || status=$? + [ "$status" -eq 0 ] && rm -f "$KPIDFILE" + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" } -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) +restart() { stop + sleep 1 start - ;; - *) - echo "Usage: $0 {start|stop|restart|reload}" - exit 1 -esac +} -exit $? +case "$1" in + start|stop|restart) + "$1";; + reload) + # Restart, since there is no true "reload" feature. + restart;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac
Signature · 1 line
2.17.1
PATCH v2 2/8 busybox: add logging configuration file
Provide a template to help users to customize syslogd and klogd without editting the startup script.
syslogd options worth to configure are remote logging (-R), rotation (-s, -b) and minimal priority level (-l).
klogd minimal priority level (-c) can be configured too, preventing non-critical kernel messages from appearing on the console.
This file is also useful as an example for init script authors.
---
Changes v1->v2
- Implement suggestions made by Nicolas Cavallari and Arnout Vandecappelle
--- package/busybox/busybox.mk | 2 ++ package/busybox/etc.default.logging | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 package/busybox/etc.default.logging
package/busybox/busybox.mk +2 -0
@@ -252,6 +252,8 @@ define BUSYBOX_INSTALL_LOGGING_SCRIPT then \ $(INSTALL) -m 0755 -D package/busybox/S01logging \ $(TARGET_DIR)/etc/init.d/S01logging; \ + $(INSTALL) -m 0644 -D package/busybox/etc.default.logging \ + $(TARGET_DIR)/etc/default/logging; \ fi endef
package/busybox/etc.default.logging new file +13 -0
@@ -0,0 +1,13 @@ +# +# /etc/default/logging (busybox version) +# + +# Use SYSLOGD_ARGS to pass additional arguments to syslogd (e.g. for log +# rotation). +# SYSLOGD_ARGS="" # (default value) + +# Use KLOGD_ARGS to pass additional arguments to klogd. +# KLOGD_ARGS="" # (default value) + +# Uncomment the line below to disable this service +# ENABLED="no"
Signature · 1 line
2.17.1
PATCH v2 2/8 busybox: add logging configuration file
Carlos,
Quoted 41 lines · Carlos Santos
Provide a template to help users to customize syslogd and klogd without editting the startup script.
syslogd options worth to configure are remote logging (-R), rotation (-s, -b) and minimal priority level (-l).
klogd minimal priority level (-c) can be configured too, preventing non-critical kernel messages from appearing on the console.
This file is also useful as an example for init script authors.
Signed-off-by Carlos Santos <[email protected]>---
Changesv1->v2
- Implement suggestions made by Nicolas Cavallari and Arnout Vandecappelle--- package/busybox/busybox.mk | 2 ++ package/busybox/etc.default.logging | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 package/busybox/etc.default.loggingpackage/busybox/busybox.mk +2
-0@@ -252,6 +252,8 @@ define BUSYBOX_INSTALL_LOGGING_SCRIPT then \ $(INSTALL) -m 0755 -D package/busybox/S01logging \ $(TARGET_DIR)/etc/init.d/S01logging; \ + $(INSTALL) -m 0644 -D package/busybox/etc.default.logging \ + $(TARGET_DIR)/etc/default/logging; \ fi endefpackage/busybox/etc.default.logging new file +0
-0
package/busybox/etc.default.logging line 4
Quoted 4 lines
package/busybox/etc.default.logging new file +4
-0@@ -0,0 +1,13 @@ +# +# /etc/default/logging (busybox version) +# +
Would it possibly help the user when determining settings to include man page links in these example configs or link to the docs in the source tree?
Quoted 10 lines
package/busybox/etc.default.logging new file +9
-1+# Use SYSLOGD_ARGS to pass additional arguments to syslogd (e.g. for log +# rotation). +# SYSLOGD_ARGS="" # (default value) + +# Use KLOGD_ARGS to pass additional arguments to klogd. +# KLOGD_ARGS="" # (default value) + +# Uncomment the line below to disable this service +# ENABLED="no" --
Quoted 2 lines
2.17.1
Matt
PATCH v2 3/8 rsyslog: update S01logging
In reply to Carlos SantosReformat and fix rsyslog startup script for better quality and code style:
- Indent with tabs, not spaces.
- Support a configuration file at /etc/default (an example file will be added in forthcomming patch).
- Support a configuration variable that completely disables the service and issues a warning message on any invocation.
---
Changes v1->v2
- Implement suggestions made by Nicolas Cavallari and Arnout Vandecappelle
--- package/rsyslog/S01logging | 68 +++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 23 deletions(-)
package/rsyslog/S01logging +45 -23
@@ -1,36 +1,58 @@ #!/bin/sh +DAEMON="rsyslogd" +PIDFILE="/var/run/$DAEMON.pid" + +RSYSLOGD_ARGS="" +ENABLED="yes" + +# shellcheck source=/dev/null +[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" + +if [ "$ENABLED" != "yes" ]; then + printf '%s is disabled\n' "$DAEMON" + exit 0 +fi + start() { - printf "Starting rsyslog daemon: " - start-stop-daemon -S -q -p /var/run/rsyslogd.pid --exec /usr/sbin/rsyslogd - [ $? = 0 ] && echo "OK" || echo "FAIL" + printf 'Starting %s: ' "$DAEMON" + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon -S -q -p "$PIDFILE" -x /usr/sbin/rsyslogd -- $RSYSLOGD_ARGS + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" } stop() { - printf "Stopping rsyslog daemon: " - start-stop-daemon -K -q -p /var/run/rsyslogd.pid - [ $? = 0 ] && echo "OK" || echo "FAIL" + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -q -p "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" } restart() { - stop - sleep 1 - start + stop + sleep 1 + start } case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - restart - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 + start|stop|restart) + "$1";; + reload) + # Restart, since there is no true "reload" feature (does not + # reconfigure/restart on SIGHUP, just closes all open files). + restart;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 esac - -exit $?
Signature · 1 line
2.17.1
PATCH v2 4/8 rsyslog: add logging configuration file
In reply to Carlos SantosProvide a template to help users to customize rsyslog without editting the startup script. Also warn about options that must not be used.
Add instructions on how to configure debugging, since it a bit tricky when rsyslogd runs in background, requiring a separete log file.
This file is also useful as an example for init script authors.
---
Changes v1->v2
- Document that "-n" command line option must not be used.
- Small improvements in comments.
--- package/rsyslog/etc.default.logging | 15 +++++++++++++++ package/rsyslog/rsyslog.mk | 2 ++ 2 files changed, 17 insertions(+) create mode 100644 package/rsyslog/etc.default.logging
package/rsyslog/etc.default.logging new file +15 -0
@@ -0,0 +1,15 @@ +# +# /etc/default/logging (rsyslog version) +# + +# Use RSYSLOGD_ARGS to pass additional arguments to rsyslogd. +# - Do NOT use "-i pid_file", "-n", nor "-v", since they will break the +# startup script. +# - Use "-d" to enable debug (see below). Warning: log files may be HUGE! +# RSYSLOGD_ARGS="" # (default value) + +# You will need this along with "-d". +# RSYSLOG_DEBUGLOG="/var/log/rsyslogd"; export RSYSLOG_DEBUGLOG + +# Uncomment the line below to disable this service +# ENABLED="no"
package/rsyslog/rsyslog.mk +2 -0
@@ -74,6 +74,8 @@ endif define RSYSLOG_INSTALL_INIT_SYSV $(INSTALL) -m 0755 -D package/rsyslog/S01logging \ $(TARGET_DIR)/etc/init.d/S01logging + $(INSTALL) -m 0644 -D package/rsyslog/etc.default.logging \ + $(TARGET_DIR)/etc/default/logging endef # The rsyslog.service is installed by rsyslog, but the link is not created
Signature · 1 line
2.17.1
PATCH v2 5/8 sysklogd: update S01logging
In reply to Carlos SantosReformat and fix syslogd/klogd startup script for better quality and code style:
- Implement start, stop, restart and reload as functions, like in other S01logging scripts, using start-stop-daemon.
- Indent with tabs, not spaces.
- Detect and report start/stop errors (previous version ignored them and always reported OK).
- Support a configuration file at /etc/default (an example file will be added in forthcomming patch).
- Support a configuration variable that completely disables the service and issues a warning message on any invocation.
- Do not kill syslogd in "reload". Send a SIGHUP signal, instructing it to perform a re-initialization. Also do not kill klogd. Send a signal (default 0, which does nothing). Users can configure this signal in /etc/default/logging to either SIGUSR1 or SIGUSR2.
---
Changes v1->v2
- Implement suggestions made by Arnout Vandecappelle
--- package/sysklogd/S01logging | 90 ++++++++++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 20 deletions(-)
package/sysklogd/S01logging +70 -20
@@ -1,25 +1,75 @@ #!/bin/sh -case "$1" in - start) - printf "Starting logging: " - /sbin/syslogd -m 0 - /sbin/klogd +DAEMON="sysklogd" +SPIDFILE="/var/run/syslogd.pid" +KPIDFILE="/var/run/klogd.pid" + +SYSLOGD_ARGS="-m 0" +KLOGD_ARGS="" +KLOGD_RELOAD="0" +ENABLED="yes" + +# shellcheck source=/dev/null +[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" + +if [ "$ENABLED" != "yes" ]; then + printf '%s is disabled\n' "$DAEMON" + exit 0 +fi + +start() { + printf 'Starting %s: ' "$DAEMON" + status=0 + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon -S -q -p "$SPIDFILE" -x /sbin/syslogd -- $SYSLOGD_ARGS || status=$? + start-stop-daemon -S -q -p "$KPIDFILE" -x /sbin/klogd -- $KLOGD_ARGS || status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "$DAEMON" + status=0 + start-stop-daemon -K -q -p "$SPIDFILE" || status=$? + start-stop-daemon -K -q -p "$KPIDFILE" || status=$? + if [ "$status" -eq 0 ]; then echo "OK" - ;; - stop) - printf "Stopping logging: " - [ -f /var/run/klogd.pid ] && kill `cat /var/run/klogd.pid` - [ -f /var/run/syslogd.pid ] && kill `cat /var/run/syslogd.pid` + else + echo "FAIL" + fi + return "$status" +} + +restart() { + stop + sleep 1 + start +} + +# SIGHUP makes syslogd reload its configuration +# SIGUSR1 makes klogd reload kernel module symbols +# SIGUSR2 makes klogd reload static kernel symbols and kernel module symbols +reload() { + printf 'Reloading %s: ' "$DAEMON" + status=0 + start-stop-daemon -K -s HUP -q -p "$SPIDFILE" || status=$? + start-stop-daemon -K -s "$KLOGD_RELOAD" -q -p "$KPIDFILE" || status=$? + if [ "$status" -eq 0 ]; then echo "OK" - ;; - restart|reload) - $0 stop - $0 start - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 -esac + else + echo "FAIL" + fi + return "$status" +} -exit $? +case "$1" in + start|stop|restart|reload) + "$1";; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac
Signature · 1 line
2.17.1
PATCH v2 6/8 sysklogd: add logging configuration file
In reply to Carlos SantosProvide a template to help users to customize syslogd and klogd without editting the startup script. Also warn about options that must not be used.
syslogd options worth to configure are mark interval (-m), remote log support (-r) and domain list (-s).
Give example of how to configure klogd re-initialization signal.
---
Changes v1->v2:
- Document that the "-n" command line option must not be used.
- Going against the request from Arnout Vandecappelle, keep the klogd reload configuration. Add a comment explainig why it is still useful. BTW, I work on a project which requires dynamic installation of kernel modules.
--- package/sysklogd/etc.default.logging | 30 ++++++++++++++++++++++++++++ package/sysklogd/sysklogd.mk | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 package/sysklogd/etc.default.logging
package/sysklogd/etc.default.logging new file +30 -0
@@ -0,0 +1,30 @@ +# +# /etc/default/logging (sysklog version) +# + +# Use SYSLOGD_ARGS to pass additional arguments to syslogd. +# - Do NOT use "-n", "-v", since they will break the startup script. +# - Do NOT use "-d", since debugging does not work when running in background. +# SYSLOGD_ARGS="-m 0" # (default value) + +# Use KLOGD_ARGS to pass additional arguments to klogd. +# - Do NOT use "-n", "-o" nor "-v", since they will break the startup script. +# - Do NOT use "-d", since debugging does not work when running in background. +# KLOGD_ARGS="-m 0" # (default value) + +# KLOGD_RELOAD selects the "S01logging reload" behavior. +# - "USR1" will cause the kernel module symbols to be reloaded. +# - "USR2" will cause both the static kernel symbols and the kernel module +# symbols to be reloaded. +# - "0" will do nothing. +# - Do not use any other value here. Use kill(1) for fine-grained control of +# klogd, as documented in its manual page. +# +# Most users will never need to reload klogd in buildroot context because they +# are not going to dynamically install kernel modules. In the rare cases that +# this does happen, the user should be smart enough to send a SIGUSR1/2 but +# let's keep this configurable for documentation purposes. +# KLOGD_RELOAD="0" # (default value) + +# Uncomment the line below to disable this service +# ENABLED="no"
package/sysklogd/sysklogd.mk +2 -0
@@ -25,6 +25,8 @@ endef define SYSKLOGD_INSTALL_INIT_SYSV $(INSTALL) -m 755 -D package/sysklogd/S01logging \ $(TARGET_DIR)/etc/init.d/S01logging + $(INSTALL) -m 0644 -D package/sysklogd/etc.default.logging \ + $(TARGET_DIR)/etc/default/logging endef define SYSKLOGD_INSTALL_INIT_SYSTEMD
Signature · 1 line
2.17.1
PATCH v2 7/8 syslog-ng: update S01logging
In reply to Carlos SantosReformat and fix syslog-ng startup script for better quality and code style:
- Indent with tabs, not spaces.
- Do not kill syslog-ng in "reload". Send a SIGHUP signal, instructing it to perform a re-initialization.
- Support a configuration file at /etc/default (an example file will be added in forthcomming patch).
- Support a configuration variable that completely disables the service and issues a warning message on any invocation.
---
Changes v1->v2:
- Implement changes suggested by Arnout Vandecappelle.
--- package/syslog-ng/S01logging | 73 +++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 22 deletions(-)
package/syslog-ng/S01logging +51 -22
@@ -1,17 +1,42 @@ #!/bin/sh +DAEMON="syslog-ng" +PIDFILE="/var/run/$DAEMON.pid" + +SYSLOG_NG_ARGS="" +ENABLED="yes" + +# shellcheck source=/dev/null +[ -r "/etc/default/$DAEMON"g ] && . "/etc/default/$DAEMON" + +if [ "$ENABLED" != "yes" ]; then + printf '%s is disabled\n' "$DAEMON" + exit 0 +fi + start() { - printf "Starting syslog-ng daemon: " - start-stop-daemon -S -q -p /var/run/syslog-ng.pid \ - -x /usr/sbin/syslog-ng -- --pidfile /var/run/syslog-ng.pid - [ $? = 0 ] && echo "OK" || echo "FAIL" + printf 'Starting %s: ' "$DAEMON" + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon -S -q -p "$PIDFILE" -x /usr/sbin/syslog-ng -- $SYSLOG_NG_ARGS + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" } stop() { - printf "Stopping syslog-ng daemon: " - start-stop-daemon -K -q -p /var/run/syslog-ng.pid \ - -x /usr/sbin/syslog-ng - [ $? = 0 ] && echo "OK" || echo "FAIL" + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -q -p "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" } restart() {
@@ -20,19 +45,23 @@ restart() { start } +# SIGHUP makes syslog-ng reload its configuration +reload() { + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -s HUP -q -p "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - restart - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 + start|stop|restart|reload) + "$1";; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 esac - -exit $?
Signature · 1 line
2.17.1
PATCH v2 7/8 syslog-ng: update S01logging
Quoted 25 lines · Carlos Santos,
Reformat and fix syslog-ng startup script for better quality and code style:
- Indent with tabs, not spaces.
- Do not kill syslog-ng in "reload". Send a SIGHUP signal, instructing it to perform a re-initialization.
- Support a configuration file at/etc/default(an example file will be added in forthcomming patch).
- Support a configuration variable that completely disables the service and issues a warning message on any invocation.Signed-off-by Carlos Santos <[email protected]>---
Changesv1->v2:
- Implement changes suggested by Arnout Vandecappelle.--- package/syslog-ng/S01logging | 73 +++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 22 deletions(-)package/syslog-ng/S01logging +0
-0@@ -1,17 +1,42 @@ #!/bin/sh
package/syslog-ng/S01logging line 11
Quoted 10 lines
package/syslog-ng/S01logging +8
-0+DAEMON="syslog-ng" +PIDFILE="/var/run/$DAEMON.pid" + +SYSLOG_NG_ARGS="" +ENABLED="yes" + +# shellcheck source=/dev/null +[ -r "/etc/default/$DAEMON"g ] && . "/etc/default/$DAEMON"
Stray 'g'.
+
Quoted 79 lines
package/syslog-ng/S01logging +8
-4+if [ "$ENABLED" != "yes" ]; then + printf '%s is disabled\n' "$DAEMON" + exit 0 +fi + start() { - printf "Starting syslog-ng daemon: " - start-stop-daemon -S -q -p /var/run/syslog-ng.pid \ - -x /usr/sbin/syslog-ng -- --pidfile /var/run/syslog-ng.pid - [ $? = 0 ] && echo "OK" || echo "FAIL" + printf 'Starting %s: ' "$DAEMON" + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon -S -q -p "$PIDFILE" -x /usr/sbin/syslog-ng --$SYSLOG_NG_ARGS
package/syslog-ng/S01logging +34
-19+ status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" } stop() { - printf "Stopping syslog-ng daemon: " - start-stop-daemon -K -q -p /var/run/syslog-ng.pid \ - -x /usr/sbin/syslog-ng - [ $? = 0 ] && echo "OK" || echo "FAIL" + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -q -p "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" } restart() {@@ -20,19 +45,23 @@ restart() { start } +# SIGHUP makes syslog-ng reload its configuration +reload() { + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -s HUP -q -p "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - restart - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 + start|stop|restart|reload) + "$1";; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 esac - -exit $? --
Quoted 3 lines
2.17.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180929/cf397922/attachment.html>
PATCH v2 8/8 syslog-ng: add logging configuration file
In reply to Carlos SantosProvide a template to help users to customize syslog-ng without editting the startup script. Mostly warn about options that must not be used.
This file is also useful as an example for init script authors.
---
Changes v1->v2
- Document that -F/--foreground must not be used
--- package/syslog-ng/etc.default.logging | 14 ++++++++++++++ package/syslog-ng/syslog-ng.mk | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 package/syslog-ng/etc.default.logging
package/syslog-ng/etc.default.logging new file +14 -0
@@ -0,0 +1,14 @@ +# +# /etc/default/logging (syslog-ng version) +# + +# Use SYSLOG_NG_ARGS to pass additional arguments to rsyslogd. +# - Do NOT use "-F/--foreground", "--help"/"-h", "--version"/"-V", "--stderr"/"-e", +# "--syntax-only"/"-s", or "--process-mode=<background|safe-background>", since +# they will break the startup script. +# - Do NOT use "--debug"/"-d", since debugging does not work when running in +# background. +# SYSLOG_NG_ARGS="" # (default value) + +# Uncomment the line below to disable this service +# ENABLED="no"
package/syslog-ng/syslog-ng.mk +2 -0
@@ -95,6 +95,8 @@ endif define SYSLOG_NG_INSTALL_INIT_SYSV $(INSTALL) -m 0755 -D package/syslog-ng/S01logging \ $(TARGET_DIR)/etc/init.d/S01logging + $(INSTALL) -m 0644 -D package/syslog-ng/etc.default.logging \ + $(TARGET_DIR)/etc/default/logging endef # By default syslog-ng installs a number of sample configuration
Signature · 1 line
2.17.1
PATCH v2 8/8 syslog-ng: add logging configuration file
Quoted 23 lines · Carlos Santos,
Provide a template to help users to customize syslog-ng without editting the startup script. Mostly warn about options that must not be used.
This file is also useful as an example for init script authors.
Signed-off-by Carlos Santos <[email protected]>---
Changesv1->v2
- Document that -F/--foreground must not be used--- package/syslog-ng/etc.default.logging | 14 ++++++++++++++ package/syslog-ng/syslog-ng.mk | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 package/syslog-ng/etc.default.loggingpackage/syslog-ng/etc.default.logging new file +0
-0
package/syslog-ng/etc.default.logging line 5
Quoted 5 lines
package/syslog-ng/etc.default.logging new file +5
-0@@ -0,0 +1,14 @@ +# +# /etc/default/logging (syslog-ng version) +# + +# Use SYSLOG_NG_ARGS to pass additional arguments to rsyslogd.
s/rsyslog/syslog-ng/
+# - Do NOT use "-F/--foreground", "--help"/"-h", "--version"/"-V",
Quoted 26 lines
"--stderr"/"-e",
+# "--syntax-only"/"-s", or
"--process-mode=<background|safe-background>", sincepackage/syslog-ng/etc.default.logging new file +2
-0+# they will break the startup script. +# - Do NOT use "--debug"/"-d", since debugging does not work when runningin
package/syslog-ng/etc.default.logging new file +5
-0+# background. +# SYSLOG_NG_ARGS="" # (default value) + +# Uncomment the line below to disable this service +# ENABLED="no"package/syslog-ng/ renamed from package/syslog-ng/syslog-ng.mk +0
-0syslog-ng.mk
index793fea0972..a837dad841100644package/syslog-ng/syslog-ng.mk +2
-1@@ -95,6 +95,8 @@ endif define SYSLOG_NG_INSTALL_INIT_SYSV $(INSTALL) -m 0755 -D package/syslog-ng/S01logging \ $(TARGET_DIR)/etc/init.d/S01logging + $(INSTALL) -m 0644 -D package/syslog-ng/etc.default.logging \ + $(TARGET_DIR)/etc/default/logging endef # By default syslog-ng installs a number of sample configuration --
Quoted 3 lines
2.17.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180929/25dc29e2/attachment.html>
PATCH v2 1/8 busybox: update S01logging
In reply to Carlos SantosCarlos,
Quoted 4 lines · Carlos Santos
Reformat and fix syslogd/klogd startup script for better quality and code style:
Quoted 8 lines
- Detect and report start/stop errors (previous version ignored them and always reported OK).
- Use a separate function for restart.
- Implement reload as restart.
- Support a configuration variable that completely disables the service and issues a warning message on any invocation.Signed-off-by Carlos Santos <[email protected]>