Hello,
Ran into a bug with the /etc/periodic/daily/sysklogd script on the
latest version of alpine 1.8.
We needed to keep log files for more 32 days and that is why we ran
into the bug.
The bug will occur when changing the cycle to more than 9 days.
--- sysklogd Tue Jun 23 20:03:24 2009
+++ mine Tue Jun 23 20:03:39 2009
@@ -50,15 +50,16 @@
logfile=$1
# Cycle the logs
- while [ $cycle -ne 0 ]; do
+ while [ $cycle -ne 1 ]; do
p=$cycle
cycle=$(( $cycle - 1 ))
- a=$logfile.$cycle*
+ a=$logfile.$cycle.*
b=$( echo $a | sed "s/\.$cycle/\.$p/")
[ -f $a ] && mv $a $b
done
# compress .1 and let .0 be uncompressed
+ [ -f $logfile.0 ] && mv $logfile.0 $logfile.1
[ -f $logfile.1 ] && gzip $logfile.1
[ -f $logfile ] && mv $logfile $logfile.0
I didn't know who might be interested in this and didn't see sysklogd
in 1.9 so passing it onto the list.
Thanks nangel for pointing this out.
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---
On Tue, 2009-06-23 at 20:08 +0000, Michael Mason wrote:
> Hello,> Ran into a bug with the /etc/periodic/daily/sysklogd script on the > latest version of alpine 1.8.> We needed to keep log files for more 32 days and that is why we ran > into the bug.> > The bug will occur when changing the cycle to more than 9 days.>
...
> I didn't know who might be interested in this and didn't see sysklogd > in 1.9 so passing it onto the list.
I added sysklogd yesterday. This script was actually removed and
replaced with a logrotate config. This needs to be tested though.
> > Thanks nangel for pointing this out.
Thanks for sharing!
-nc
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---