[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Freeze exception: tumgreyspf 1.35-5 (bugfix: #590492)



Adam D. Barratt wrote:
> On Thu, 2010-08-26 at 13:55 +0800, Thomas Goirand wrote:
>> My tumgreyspf packag suffered from 2 issues:
>> - when there was no mail traffic, the cron.daily had errors, which sent
>> a mail to the system root user.
>> - the postinst script created a system user in /home, which was quite
>> ugly (now it goes in /var/lib/tumgreyspf).
> 
> Actually, /var/lib/tumgreyspf/${TUMUSER}, due to your use of -b:
> 
> -               useradd -m -s /bin/false -g nogroup ${TUMUSER}
> +               useradd -m -s /bin/false -g nogroup ${TUMUSER} -r -b /var/lib/tumgreyspf

> +if [ -x `which usermod` ] ; then
> +       usermod -d /var/lib/tumgreyspf
> +fi
> 
> The usermod call is missing a username to operate on.

Corrected, what was I thinking off... :(

> + echo "Warning: tumgreyspf.postinst had found an old /etc/cron.d/tumgreyspf,"
> + echo "and will be deleting it as this version of the package doesn't use the"
> + echo "old python script, but a new sh script in /etc/cron.daily/tumgreyspf."
> 
> Might I suggest something more along the lines of
> "/etc/cron.d/tumgreyspdf has been replaced
> by /etc/cron.daily/tumgreyspf; the old file has been deleted".  Aside
> from the fact that by the time the user reads the message the file _has
> been_ deleted, and the mix of tenses, the user shouldn't need to care
> that you've replaced a Python script with a shell script.
> 
> You should probably also only remove the old file if it's the version
> which was shipped by the package.

I've used the above suggested wording.

Thanks a lot for all these remarks, I've attached the new interdiff of
the corrected version in SID. Please unblock that one.

Thomas


diff -u tumgreyspf-1.35/debian/control tumgreyspf-1.35/debian/control
--- tumgreyspf-1.35/debian/control
+++ tumgreyspf-1.35/debian/control
@@ -3,7 +3,9 @@
 Priority: optional
 Maintainer: Thomas Goirand <zigo@debian.org>
 Build-Depends: debhelper (>= 7), dpatch
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
+Vcs-Browser: http://git.debian.org/?p=users/zigo/tumgreyspf.git
+Vcs-Git: http://git.debian.org/git/users/zigo/tumgreyspf.git
 Homepage: http://www.tummy.com/Community/software/tumgreyspf/
 
 Package: tumgreyspf
diff -u tumgreyspf-1.35/debian/changelog tumgreyspf-1.35/debian/changelog
--- tumgreyspf-1.35/debian/changelog
+++ tumgreyspf-1.35/debian/changelog
@@ -1,3 +1,23 @@
+tumgreyspf (1.35-6) unstable; urgency=low
+
+  * Now creates the user in /var/lib/tumgreyspf and not in
+    /var/lib/tumgreyspf/tumgreyspf like 1.35-5 was doing. The usermod call has
+    also been corrected.
+
+ -- Thomas Goirand <zigo@debian.org>  Fri, 27 Aug 2010 12:57:11 +0800
+
+tumgreyspf (1.35-5) unstable; urgency=low
+
+  * Added patch for debian/cron.daily so that the cron job doesn't spam the
+    administrator if there's no mail traffic (Closes: #590492).
+  * Added Vcs-Browser / Vcs-Git URLs.
+  * Bumped Standard-Version.
+  * Now using -r -b /var/lib/tumgreyspf to create the tumgreyspf user, and
+    modifies an eventual old setup to this new value using the usermod with
+    -d to setup the new home (LP: #610810).
+
+ -- Thomas Goirand <zigo@debian.org>  Tue, 27 Jul 2010 04:01:55 +0800
+
 tumgreyspf (1.35-4) unstable; urgency=low
 
   * Now using my zigo@debian.org as maintainer email.
diff -u tumgreyspf-1.35/debian/cron.daily tumgreyspf-1.35/debian/cron.daily
--- tumgreyspf-1.35/debian/cron.daily
+++ tumgreyspf-1.35/debian/cron.daily
@@ -1,9 +1,25 @@
 #!/bin/sh
 
-GREYLISTEXPIREDAYS=`grep GREYLISTEXPIREDAYS /etc/tumgreyspf/default.conf | cut -d'=' -f2 | awk '{print $1}' | cut -d'.' -f1`
+if [ -f /etc/tumgreyspf/default.conf ] ; then
+	GREYLISTEXPIREDAYS=`grep GREYLISTEXPIREDAYS /etc/tumgreyspf/default.conf | cut -d'=' -f2 | awk '{print $1}' | cut -d'.' -f1`
+fi
+
+if [ -z "${GREYLISTEXPIREDAYS}" ] ; then
+	GREYLISTEXPIREDAYS=10
+fi
 
 greylistDir="/var/lib/tumgreyspf/data"
 
+if ! [ -d "${greylistDir}" ] ; then
+	# echo "No tumgreyspf data folder"
+	exit 0
+fi
+
+if [ -z "$(ls ${greylistDir})" ] ; then
+	# echo "No data to clean in this run"
+	exit 0
+fi
+
 #echo -n "Now parsing all Class A in ${greylistDir}:"
 # /var/lib/tumgreyspf/data/96/52/161/check_file
 for i in ${greylistDir}/* ; do
diff -u tumgreyspf-1.35/debian/postinst tumgreyspf-1.35/debian/postinst
--- tumgreyspf-1.35/debian/postinst
+++ tumgreyspf-1.35/debian/postinst
@@ -9,13 +9,16 @@
 	echo "User ${TUMUSER} already exists: skipping creation!"
 else
 	if [ -x `which useradd` ] ; then
-		useradd -m -s /bin/false -g nogroup ${TUMUSER}
+		useradd -m -s /bin/false -g nogroup ${TUMUSER} -r -b /var/lib
 		echo "Created user ${TUMUSER}"
 	else
 		echo "Could not find the useradd binary!"
 		exit 1
 	fi
 fi
+if [ -x `which usermod` ] ; then
+	usermod -d /var/lib/tumgreyspf ${TUMUSER}
+fi
 
 chown ${TUMUSER} /var/lib/tumgreyspf
 chown -R ${TUMUSER} /var/lib/tumgreyspf/config
@@ -23,9 +26,10 @@
 chown ${TUMUSER} /var/lib/tumgreyspf/test
 chown ${TUMUSER} /var/lib/tumgreyspf/test/data
 
-# Clean up all versions, and replace by the /etc/cron.daily/tumgreyspf
+# Clean up all versions, and replace by the new /etc/cron.daily/tumgreyspf
 if [ -f /etc/cron.d/tumgreyspf ] ; then
-	echo "Warning: found /etc/cron.d/tumgreyspf, deleting!"
+	echo "/etc/cron.d/tumgreyspdf has been replaced by /etc/cron.daily/tumgreyspf;"
+	echo "the old file has been deleted."
 	rm -f /etc/cron.d/tumgreyspf
 fi
 


Reply to: