[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

logrotate email alerts for old versions of Tor



I use the deb.torproject.org repository to install Tor on my Ubuntu box.
On several occasions I've noticed in my Tor log file that it has been
telling me to upgrade for several days, without me noticing. I applied
the following changes to my logrotate config in order to get email
alerts when I need to upgrade Tor. I don't know how portable it is, but
the idea it's self should be portable. I think the root user should get
email alerts when they're running a non-recommended version of Tor.. An
entry in an often unmonitored log isn't enough.

root@server:/etc/logrotate.d# diff -u tor.original tor
--- tor.original	2009-09-18 15:32:16.000000000 -0400
+++ tor	2009-09-17 07:48:25.000000000 -0400
@@ -7,6 +7,9 @@
 	notifempty
 	create 0640 debian-tor adm
 	sharedscripts
+	prerotate
+		if [ "`grep '\[warn\] Please upgrade' /var/log/tor/log`" != "" ]; then echo "Upgrade Tor"|mail -s "Upgrade Tor" root; fi
+	endscript
 	postrotate
 		/etc/init.d/tor reload > /dev/null
 	endscript

-- 
Erilenz