Subject: [alpine-devel] Bug in sysklogd daily rotate

From: Michael Mason <[email-masked]>
Date: Tue, 23 Jun 2009 20:08:51 +0000

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:  [email-masked]
Help:         [email-masked]
---

---

From: <[email-masked]>
Date: Tue, 23 Jun 2009 20:02:37 -0300

"clamsmtp" in Alpine 1.9.0 alpha 15 seems to have a problem.

bsna:~# nc 127.0.0.1:10025
clamsmtpd: couldn't create thread: Resource temporarily unavailable
421 Local Error, cannot start thread

---

---

From: Natanael Copa <[email-masked]>
Date: Wed, 24 Jun 2009 07:53:16 +0200

> The bug will occur when changing the cycle to more than 9 days.
...
> 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

---