Skip to contentSkip to conversation

busybox: Make S01logging source a default file.

PATCH Superseded Nicolas Cavallari 4 participants 6 messages Feb 26, 2016 – Mar 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 busybox: Make S01logging source a default file.

The default syslog parameters are to keep only 200-400 KiB of logs, which is very few if there is a spammy daemon on the system, or a daemon that fails and then spams errors that hides the original problem.

Make S01logging source a /etc/default/logging file where these parameters can be overridden.

---
 package/busybox/S01logging | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
package/busybox/S01logging +6 -2
index a72c69d..af7bdff 100644
@@ -3,10 +3,14 @@
 # Start logging
 #
 
+SYSLOGD_ARGS=-n
+KLOGD_ARGS=-n
+[ -e /etc/default/logging ] && . /etc/default/logging
+
 start() {
 	printf "Starting logging: "
-	start-stop-daemon -b -S -q -m -p /var/run/syslogd.pid --exec /sbin/syslogd -- -n
-	start-stop-daemon -b -S -q -m -p /var/run/klogd.pid --exec /sbin/klogd -- -n
+	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"
 }
 
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 busybox: Make S01logging source a default file.

Hi Nicolas,

Quoted 17 lines · Nicolas Cavallari

The default syslog parameters are to keep only 200-400 KiB of logs, which is very few if there is a spammy daemon on the system, or a daemon that fails and then spams errors that hides the original problem.

Make S01logging source a /etc/default/logging file where these parameters can be overridden.

---
 package/busybox/S01logging | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
package/busybox/S01logging +0 -0
index a72c69d..af7bdff 100644

package/busybox/S01logging line 8

Quoted 6 lines
package/busybox/S01logging +3 -0
@@ -3,10 +3,14 @@
 # Start logging
 #
 
+SYSLOGD_ARGS=-n
+KLOGD_ARGS=-n
+[ -e /etc/default/logging ] && . /etc/default/logging

Instead of '-e', we typically use '-r'.

Other than that, looks good. Could you send v2 with this change?

package/busybox/S01logging line 13

Quoted 6 lines
package/busybox/S01logging +2 -2
 start() {
 	printf "Starting logging: "
-	start-stop-daemon -b -S -q -m -p /var/run/syslogd.pid --exec /sbin/syslogd -- -n
-	start-stop-daemon -b -S -q -m -p /var/run/klogd.pid --exec /sbin/klogd -- -n
+	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

Unrelated to your patch, but passing '-n' (Run in foreground) looks strange since we are daemonizing those processes anyway. Do you know any good reason for this?

Signature · 4 lines
Luca

-- 
Luca
#2 lore raw

PATCH 1/1 busybox: Make S01logging source a default file.

Quoted 31 lines · Luca Ceresoli

Hi Nicolas,

Quoted 17 lines · Nicolas Cavallari

The default syslog parameters are to keep only 200-400 KiB of logs, which is very few if there is a spammy daemon on the system, or a daemon that fails and then spams errors that hides the original problem.

Make S01logging source a /etc/default/logging file where these parameters can be overridden.

---
 package/busybox/S01logging | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
package/busybox/S01logging +0 -0
index a72c69d..af7bdff 100644

package/busybox/S01logging line 8

Quoted 6 lines
package/busybox/S01logging +3 -0
@@ -3,10 +3,14 @@
 # Start logging
 #
 
+SYSLOGD_ARGS=-n
+KLOGD_ARGS=-n
+[ -e /etc/default/logging ] && . /etc/default/logging

Instead of '-e', we typically use '-r'.

Other than that, looks good. Could you send v2 with this change?

Quoted 10 lines

package/busybox/S01logging line 13

Quoted 6 lines
package/busybox/S01logging +2 -2
 start() {
 	printf "Starting logging: "
-	start-stop-daemon -b -S -q -m -p /var/run/syslogd.pid --exec /sbin/syslogd -- -n
-	start-stop-daemon -b -S -q -m -p /var/run/klogd.pid --exec /sbin/klogd -- -n
+	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

Unrelated to your patch, but passing '-n' (Run in foreground) looks strange since we are daemonizing those processes anyway. Do you know any good reason for this?

I do: these daemons don't create a PID file, and if they daemonize and
start-stop-daemon creates the PID file, the PID logged in there will be wrong (it will be the PID of the exited parent).

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH 1/1 busybox: Make S01logging source a default file.

Dear Arnout,

Quoted 1 line · Arnout Vandecappelle

On 03/01/16 23:47, Luca Ceresoli wrote:

[...]

Quoted 7 lines
Quoted 3 lines

Unrelated to your patch, but passing '-n' (Run in foreground) looks strange since we are daemonizing those processes anyway. Do you know any good reason for this?

I do: these daemons don't create a PID file, and if they daemonize and
start-stop-daemon creates the PID file, the PID logged in there will be wrong (it will be the PID of the exited parent).

Good point. Thanks.

Signature · 1 line
Luca
#4 lore raw

PATCH v2 1/1 busybox: Make S01logging source a default file.

In reply to Luca Ceresoli

The default syslog parameters are to keep only 200-400 KiB of logs, which is very few if there is a spammy daemon on the system, or a daemon that fails and then spams errors that hides the original problem.

Make S01logging source a /etc/default/logging file where these parameters can be overridden.

---
 package/busybox/S01logging | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
package/busybox/S01logging +6 -2
index a72c69d..4632a4c 100644
@@ -3,10 +3,14 @@
 # Start logging
 #
 
+SYSLOGD_ARGS=-n
+KLOGD_ARGS=-n
+[ -r /etc/default/logging ] && . /etc/default/logging
+
 start() {
 	printf "Starting logging: "
-	start-stop-daemon -b -S -q -m -p /var/run/syslogd.pid --exec /sbin/syslogd -- -n
-	start-stop-daemon -b -S -q -m -p /var/run/klogd.pid --exec /sbin/klogd -- -n
+	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"
 }
 
Signature · 1 line
2.7.0
#5 lore raw

PATCH v2 1/1 busybox: Make S01logging source a default file.

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Nicolas" == Nicolas Cavallari <[email protected]> writes:

The default syslog parameters are to keep only 200-400 KiB of logs, which is very few if there is a spammy daemon on the system, or a daemon that fails and then spams errors that hides the original problem.

Make S01logging source a /etc/default/logging file where these parameters can be overridden.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard