From steffen at sdaoden.eu Fri Jan 17 21:55:49 2020 From: steffen at sdaoden.eu (Steffen Nurpmeso) Date: Fri, 17 Jan 2020 22:55:49 +0100 Subject: [crux-contrib] New syslogd init script Message-ID: <20200117215549.vY3WG%steffen@sdaoden.eu> Hello J?rgen, hello all. Wonderful new BSD-style syslogd with builtin log rotation support! It makes available remote logging by default though, which is why on FreeBSD the options -s (or even -ss) are recommendet. Please find below. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) -------------- next part -------------- #!/bin/sh # # /etc/rc.d/sysklogd: start/stop syslog daemon # SSD=/sbin/start-stop-daemon PROG=/usr/sbin/syslogd OPTS=-ss PID=/var/run/syslogd.pid case $1 in start) $SSD --start --oknodo --pidfile $PID --exec $PROG -- $OPTS ;; stop) $SSD --stop --retry 10 --pidfile $PID ;; restart) $0 stop $0 start ;; status) $SSD --status --pidfile $PID case $? in 0) echo "$PROG is running with pid $(cat $PID)" ;; 1) echo "$PROG is not running but the pid file $PID exists" ;; 3) echo "$PROG is not running" ;; 4) echo "Unable to determine the program status" ;; esac ;; *) echo "usage: $0 [start|stop|restart|status]" ;; esac # End of file From steffen at sdaoden.eu Fri Jan 17 22:05:56 2020 From: steffen at sdaoden.eu (Steffen Nurpmeso) Date: Fri, 17 Jan 2020 23:05:56 +0100 Subject: [crux-contrib] New syslogd init script In-Reply-To: <20200117215549.vY3WG%steffen@sdaoden.eu> References: <20200117215549.vY3WG%steffen@sdaoden.eu> Message-ID: <20200117220556._jMQu%steffen@sdaoden.eu> Steffen Nurpmeso wrote in <20200117215549.vY3WG%steffen at sdaoden.eu>: |Hello J?rgen, hello all. | |Wonderful new BSD-style syslogd with builtin log rotation support! |It makes available remote logging by default though, which is why |on FreeBSD the options -s (or even -ss) are recommendet. And how about dropping rotatelog, /var/log/old and simply using below /etc/syslog.conf? A nice weekend everybody. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) -------------- next part -------------- # # /etc/syslog.conf # *.emerg * kern.* /var/log/kernel ;rotate=1M:3 authpriv,auth.info /var/log/auth ;rotate=200k:3 mail.info /var/log/mail ;rotate=1M:10 cron.info /var/log/cron ;rotate=200k:3 *.info;authpriv,auth,mail,cron,kern.none /var/log/messages ;rotate=1M:5 *.=debug;kern.none /var/log/debug ;rotate=200k:3 include /etc/syslog.d/*.conf # End of file From fredrik at rinnestam.se Sat Jan 18 00:26:51 2020 From: fredrik at rinnestam.se (Fredrik) Date: Sat, 18 Jan 2020 01:26:51 +0100 Subject: [crux-contrib] New syslogd init script In-Reply-To: <20200117220556._jMQu%steffen@sdaoden.eu> References: <20200117215549.vY3WG%steffen@sdaoden.eu> <20200117220556._jMQu%steffen@sdaoden.eu> Message-ID: <7978be63-dacf-9015-dac0-93efcf695261@rinnestam.se> On 2020-01-17 23:05, Steffen Nurpmeso wrote: > Steffen Nurpmeso wrote in <20200117215549.vY3WG%steffen at sdaoden.eu>: > |Hello J?rgen, hello all. > | > |Wonderful new BSD-style syslogd with builtin log rotation support! > |It makes available remote logging by default though, which is why > |on FreeBSD the options -s (or even -ss) are recommendet. > > And how about dropping rotatelog, /var/log/old and simply using > below /etc/syslog.conf? > > A nice weekend everybody. > Looks good. Dont think its a good idea to abandon rotatelog mid-release since people might use it for more custom stuff. Even abandoning it completely for next release would be unfortunate imho. Not everything logs through syslog /f From steffen at sdaoden.eu Sat Jan 18 20:26:48 2020 From: steffen at sdaoden.eu (Steffen Nurpmeso) Date: Sat, 18 Jan 2020 21:26:48 +0100 Subject: [crux-contrib] New syslogd init script In-Reply-To: <7978be63-dacf-9015-dac0-93efcf695261@rinnestam.se> References: <20200117215549.vY3WG%steffen@sdaoden.eu> <20200117220556._jMQu%steffen@sdaoden.eu> <7978be63-dacf-9015-dac0-93efcf695261@rinnestam.se> Message-ID: <20200118202648.J5Qup%steffen@sdaoden.eu> Fredrik wrote in <7978be63-dacf-9015-dac0-93efcf695261 at rinnestam.se>: |On 2020-01-17 23:05, Steffen Nurpmeso wrote: |> Steffen Nurpmeso wrote in <20200117215549.vY3WG%steffen at sdaoden.eu>: |>|Hello J?rgen, hello all. |>| |>|Wonderful new BSD-style syslogd with builtin log rotation support! |>|It makes available remote logging by default though, which is why |>|on FreeBSD the options -s (or even -ss) are recommendet. |> |> And how about dropping rotatelog, /var/log/old and simply using |> below /etc/syslog.conf? |> |> A nice weekend everybody. | |Looks good. Dont think its a good idea to abandon rotatelog mid-release |since people might use it for more custom stuff. Even abandoning it |completely for next release would be unfortunate imho. Not everything |logs through syslog Sure. For me the problem with it was that there is no size restriction, it only rotates via cron. Now on my server i do have a partition only for the log files, but even there i do not want to get disk full errors because other logs would be incomplete. (Despite not knowing how syslog behaves if it cannot put new entries, i never tried.) I feel much saver when i can specify it, so i can calculate the maximum space necessary for all logs, and still have some pad. Hm. rotatelog and its syslog cron file are part of the sysklogd package. :) And really hard to adjust. I for one am really happy with the new syslog! Despite what is still missing for me is a hook that gets called when files actually get rotated. On the VM, which still does not drive CRUX but Alpine, busybox syslog can also not call hooks, but knows about rotation and size limit. busybox has inotifyd, so i can set watches on /var/log, even though i hate it So i wrote the patch as attached. It seems to fix a syslog.conf option parsing bug, too. I'll mail him that in a second. I now have *.emerg * kern.* /var/log/kernel ;rotate=1M:3,rotatehook=/root/syslog.sh authpriv,auth.info /var/log/auth ;rotate=200k:3,rotatehook=/root/syslog.sh mail.info /var/log/mail ;rotate=1M:10,rotatehook=/root/syslog.sh cron.info /var/log/cron ;rotate=200k:3,rotatehook=/root/syslog.sh *.info;authpriv,auth,mail,cron,kern.none /var/log/messages ;rotate=1M:5,rotatehook=/root/syslog.sh *.=debug;kern.none /var/log/debug ;rotate=200k:3,rotatehook=/root/syslog.sh include /etc/syslog.d/*.conf And seems to work great! :) --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) -------------- next part -------------- A non-text attachment was scrubbed... Name: sysklogd.diff Type: text/x-diff Size: 3199 bytes Desc: not available URL: From steffen at sdaoden.eu Sun Jan 19 00:15:02 2020 From: steffen at sdaoden.eu (Steffen Nurpmeso) Date: Sun, 19 Jan 2020 01:15:02 +0100 Subject: [crux-contrib] New syslogd init script In-Reply-To: <20200118202648.J5Qup%steffen@sdaoden.eu> References: <20200117215549.vY3WG%steffen@sdaoden.eu> <20200117220556._jMQu%steffen@sdaoden.eu> <7978be63-dacf-9015-dac0-93efcf695261@rinnestam.se> <20200118202648.J5Qup%steffen@sdaoden.eu> Message-ID: <20200119001502.NWxNb%steffen@sdaoden.eu> Steffen Nurpmeso wrote in <20200118202648.J5Qup%steffen at sdaoden.eu>: |Fredrik wrote in <7978be63-dacf-9015-dac0-93efcf695261 at rinnestam.se>: ||On 2020-01-17 23:05, Steffen Nurpmeso wrote: ||> Steffen Nurpmeso wrote in <20200117215549.vY3WG%steffen at sdaoden.eu>: ... ||>|Wonderful new BSD-style syslogd with builtin log rotation support! ||>|It makes available remote logging by default though, which is why ||>|on FreeBSD the options -s (or even -ss) are recommendet. ... |Despite what is still missing for me is a hook that gets called |when files actually get rotated. On the VM, which still does not ... |So i wrote the patch as attached. It seems to fix a syslog.conf |option parsing bug, too. I'll mail him that in a second. I now So, and that bugfix was incomplete/wrong. Please find attached a diff which fixes that correctly. Otherwise unchanged. |And seems to work great! :) That i how i like logging for sure. Auto-rotation, compression of elder rotated logs, and a hook which informs rotation happened. Happy. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) -------------- next part -------------- A non-text attachment was scrubbed... Name: sysklogd.diff Type: text/x-diff Size: 3531 bytes Desc: not available URL: From fredrik at rinnestam.se Sun Jan 19 13:53:55 2020 From: fredrik at rinnestam.se (Fredrik) Date: Sun, 19 Jan 2020 14:53:55 +0100 Subject: [crux-contrib] New syslogd init script In-Reply-To: <20200119001502.NWxNb%steffen@sdaoden.eu> References: <20200117215549.vY3WG%steffen@sdaoden.eu> <20200117220556._jMQu%steffen@sdaoden.eu> <7978be63-dacf-9015-dac0-93efcf695261@rinnestam.se> <20200118202648.J5Qup%steffen@sdaoden.eu> <20200119001502.NWxNb%steffen@sdaoden.eu> Message-ID: <400f207b-a29d-59a7-e09d-f9778d550e1f@rinnestam.se> On 2020-01-19 01:15, Steffen Nurpmeso wrote: > Steffen Nurpmeso wrote in <20200118202648.J5Qup%steffen at sdaoden.eu>: > |Fredrik wrote in <7978be63-dacf-9015-dac0-93efcf695261 at rinnestam.se>: > ||On 2020-01-17 23:05, Steffen Nurpmeso wrote: > ||> Steffen Nurpmeso wrote in <20200117215549.vY3WG%steffen at sdaoden.eu>: > ... > ||>|Wonderful new BSD-style syslogd with builtin log rotation support! > ||>|It makes available remote logging by default though, which is why > ||>|on FreeBSD the options -s (or even -ss) are recommendet. > ... > |Despite what is still missing for me is a hook that gets called > |when files actually get rotated. On the VM, which still does not > ... > |So i wrote the patch as attached. It seems to fix a syslog.conf > |option parsing bug, too. I'll mail him that in a second. I now > > So, and that bugfix was incomplete/wrong. > Please find attached a diff which fixes that correctly. > Otherwise unchanged. > > |And seems to work great! :) > > That i how i like logging for sure. Auto-rotation, compression of > elder rotated logs, and a hook which informs rotation happened. > Happy. > > --steffen Agreed - I like it too! For now i've implemented your suggestion to not listen for network connections by default. Have you tried getting the rotation stuff implemented upstream? /f From steffen at sdaoden.eu Mon Jan 20 16:13:02 2020 From: steffen at sdaoden.eu (Steffen Nurpmeso) Date: Mon, 20 Jan 2020 17:13:02 +0100 Subject: [crux-contrib] New syslogd init script In-Reply-To: <400f207b-a29d-59a7-e09d-f9778d550e1f@rinnestam.se> References: <20200117215549.vY3WG%steffen@sdaoden.eu> <20200117220556._jMQu%steffen@sdaoden.eu> <7978be63-dacf-9015-dac0-93efcf695261@rinnestam.se> <20200118202648.J5Qup%steffen@sdaoden.eu> <20200119001502.NWxNb%steffen@sdaoden.eu> <400f207b-a29d-59a7-e09d-f9778d550e1f@rinnestam.se> Message-ID: <20200120161302.SsbIC%steffen@sdaoden.eu> Hello Fredrik. Fredrik wrote in <400f207b-a29d-59a7-e09d-f9778d550e1f at rinnestam.se>: |On 2020-01-19 01:15, Steffen Nurpmeso wrote: |> Steffen Nurpmeso wrote in <20200118202648.J5Qup%steffen at sdaoden.eu>: |>|Fredrik wrote in <7978be63-dacf-9015-dac0-93efcf695261 at rinnestam.se>: |>||On 2020-01-17 23:05, Steffen Nurpmeso wrote: |>||> Steffen Nurpmeso wrote in <20200117215549.vY3WG%steffen at sdaoden.eu>: |> ... |>||>|Wonderful new BSD-style syslogd with builtin log rotation support! |>||>|It makes available remote logging by default though, which is why |>||>|on FreeBSD the options -s (or even -ss) are recommendet. |> ... |>|Despite what is still missing for me is a hook that gets called |>|when files actually get rotated. On the VM, which still does not |> ... |>|So i wrote the patch as attached. It seems to fix a syslog.conf |>|option parsing bug, too. I'll mail him that in a second. I now |> |> So, and that bugfix was incomplete/wrong. |> Please find attached a diff which fixes that correctly. |> Otherwise unchanged. |> |>|And seems to work great! :) |> |> That i how i like logging for sure. Auto-rotation, compression of |> elder rotated logs, and a hook which informs rotation happened. |> Happy. |> |> --steffen | |Agreed - I like it too! For now i've implemented your suggestion to not |listen for network connections by default. That is a good default i would say. |Have you tried getting the rotation stuff implemented upstream? Ach, sorry, my "bugfix" made things worse. But yes, i did, he is interested, but would like to have it differently. He would prefer a generic "notify HOOK" at top level, rather than a per-rule hook. I will (try to) do it today, after i have falsely claimed the option parsing was wrong, .. blush. In fact i suggested such a thing for busybox syslogd in 2016, hm. Let's see whether i can do that for sysklogd. I also just responded to his answer with another thought, since on IRC ][_R_][ said he needs YEAR/MONTH/DAY, i asked for the possibility to rotate all (configured) logs on signal, so with that and the "notify" hook even such a scenario should be handable easily. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From steffen at sdaoden.eu Tue Jan 21 21:18:29 2020 From: steffen at sdaoden.eu (Steffen Nurpmeso) Date: Tue, 21 Jan 2020 22:18:29 +0100 Subject: [crux-contrib] New syslogd init script In-Reply-To: <20200120161302.SsbIC%steffen@sdaoden.eu> References: <20200117215549.vY3WG%steffen@sdaoden.eu> <20200117220556._jMQu%steffen@sdaoden.eu> <7978be63-dacf-9015-dac0-93efcf695261@rinnestam.se> <20200118202648.J5Qup%steffen@sdaoden.eu> <20200119001502.NWxNb%steffen@sdaoden.eu> <400f207b-a29d-59a7-e09d-f9778d550e1f@rinnestam.se> <20200120161302.SsbIC%steffen@sdaoden.eu> Message-ID: <20200121211829.6YEx3%steffen@sdaoden.eu> Steffen Nurpmeso wrote in <20200120161302.SsbIC%steffen at sdaoden.eu>: |Fredrik wrote in <400f207b-a29d-59a7-e09d-f9778d550e1f at rinnestam.se>: ||On 2020-01-19 01:15, Steffen Nurpmeso wrote: ||> Steffen Nurpmeso wrote in <20200118202648.J5Qup%steffen at sdaoden.eu>: ||>|Fredrik wrote in <7978be63-dacf-9015-dac0-93efcf695261 at rinnestam.se>: ||>||On 2020-01-17 23:05, Steffen Nurpmeso wrote: ||>||> Steffen Nurpmeso wrote in <20200117215549.vY3WG%steffen at sdaoden.eu>: ||> ... ||>||>|Wonderful new BSD-style syslogd with builtin log rotation support! ||>||>|It makes available remote logging by default though, which is why ||>||>|on FreeBSD the options -s (or even -ss) are recommendet. ||> ... ||>|Despite what is still missing for me is a hook that gets called ||>|when files actually get rotated. On the VM, which still does not ... ||> That i how i like logging for sure. Auto-rotation, compression of ||> elder rotated logs, and a hook which informs rotation happened. ... ||Agreed - I like it too! For now i've implemented your suggestion to not ||listen for network connections by default. | |That is a good default i would say. | ||Have you tried getting the rotation stuff implemented upstream? So i just have finished that sysklogd intermezzo, let's see whether Joachim merges it in. If he does we will get a notify keyword, which can be used multiple times, and sysklogd will forcefully rotate all files for which rotation is configured when receiving a SIGUSR2. Works fine here, my /etc/syslog.conf became # # /etc/syslog.conf # *.emerg * kern.* /var/log/kernel ;rotate=1M:5 authpriv,auth.info /var/log/auth ;rotate=200k:3 mail.info /var/log/mail ;rotate=1M:5 cron.info /var/log/cron ;rotate=200k:3 *.info;authpriv,auth,mail,cron,kern.none /var/log/messages ;rotate=1M:5 *.=debug;kern.none /var/log/debug ;rotate=200k:3 include /etc/syslog.d/*.conf notify /root/syslog.sh # End of file I will attach the diff, maybe someone wants to try it out. Ciao, --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) -------------- next part -------------- A non-text attachment was scrubbed... Name: sysklogd.diff Type: text/x-diff Size: 17091 bytes Desc: not available URL: