Bug#670681: /etc/init.d/postgrey script doesn't work properly
Control: tag -1 + confirmed Hi, Andreas Metzler wrote: FYI this totally broke greylisting for me after upgrading to wheezy and migrating to a new server as service postgrey restart did not restart the daemon and therefore did not apply the configuration changes I made which were necessary for a working postgrey installation. While I disagree with totally broke greylisting... I am therefore upgrading the bug-severity (rationale makes the package in question unusable or mostly so). ... or makes the package in question unusable or mostly so (which is a reason for grave, but not for serious btw.), I do agree with RC-severity and can confirm the issue. :-) I'll look into the patch and will likely do an NMU for Sid as a start. I may look into a stable update for Wheezy later, too. Regards, Axel -- ,''`. | Axel Beckert a...@debian.org, http://people.debian.org/~abe/ : :' : | Debian Developer, ftp.ch.debian.org Admin `. `' | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE `-| 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#670681: /etc/init.d/postgrey script doesn't work properly
Control: found -1 1.34-1.2 Axel Beckert wrote: [...] can confirm the issue. :-) ... in Wheezy as well as in Jessie and Sid. Regards, Axel -- ,''`. | Axel Beckert a...@debian.org, http://people.debian.org/~abe/ : :' : | Debian Developer, ftp.ch.debian.org Admin `. `' | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE `-| 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#670681: /etc/init.d/postgrey script doesn't work properly
Hi, Nye Liu wrote: /etc/init.d/postgrey passes --name to start-stop-daemon, but start-stop-daemon apparently expects a full path (/usr/sbin/postgrey vs postgrey) However, start-stop-daemon is also limited to 15 characters So stop/reload do NOT work at all. Yes. That's the core of the issue. --- /etc/init.d/postgrey-dist 2012-04-27 16:58:30.0 -0700 +++ /etc/init.d/postgrey 2012-04-27 17:05:53.0 -0700 @@ -23,6 +23,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/postgrey NAME=postgrey +SSNAME=`echo $DAEMON | cut -c -15` DESC=postfix greylisting daemon PIDFILE=/var/run/$NAME.pid @@ -51,7 +52,7 @@ start) log_daemon_msg Starting $DESC $NAME if start-stop-daemon --start --oknodo --quiet \ - --pidfile $PIDFILE --name $NAME \ + --pidfile $PIDFILE --name $SSNAME \ --startas $DAEMON -- $POSTGREY_OPTS $POSTGREY_TEXT_OPT then log_end_msg 0 @@ -63,7 +64,7 @@ stop) log_daemon_msg Stopping $DESC $NAME if start-stop-daemon --stop --oknodo --quiet \ - --pidfile $PIDFILE --name $NAME + --pidfile $PIDFILE --name $SSNAME then log_end_msg 0 else @@ -75,7 +76,7 @@ reload|force-reload) log_action_begin_msg Reloading $DESC configuration... if start-stop-daemon --stop --signal 1 --quiet \ - --pidfile $PIDFILE --name $NAME + --pidfile $PIDFILE --name $SSNAME then log_action_end_msg 0 else The stop and restart actions of an init script with this patch work fine for any postgrey process started with the same script. Contrary to my expectations, it though can't stop a process started by the current (i.e. buggy) init script. I currently don't know why this doesn't work. This patch also has another disadvantage (which was not known at the time the patch was written, so that's not a fault of the patch or its author :-), namely that since 1.35 upstream writes postgrey and the beginning of the arguments into that comm field: https://github.com/schweikert/postgrey/commit/d496dfbc13412fda9d72dc1c1eb6506c84265543 So the above variant will need to be changed with the next upstream release anyways... Olaf Zaplinski wrote: Patch did not work for me. What worked was this change of init script: # line 80 - replaced --pidfile $PIDFILE --name $SSNAME # with --pidfile $PIDFILE Works, too, but also fails to stop a postgrey daemon which was started by the previous version of the init script. In comparison to Nye Liu's solution, this one at least throws an error in this case and would likely continue to work unmodified with the recent new upstream release 1.35. So I currently tend to this solution, but I'll first need to check if it has other implications. Another variant would be to use -u postgrey given that no other process runs under the user postgrey. But according to its man page, postgreyreport runs under the postgrey user by default, too, and if it's running while the init script tries to stop the postgrey daemon, that script would be killed, too. Not perfect either... Leoš Bitto wrote on 12 Sep 2013: The patch supplied by Nye Liu fixes this issue for me on a system running Debian stable (wheezy). However, on another system which is updated to Debian testing (jessie) the startup script does not work at all - it just prints green [ok] but postgrey is actually not started! The latter may be a different issue, maybe https://bugs.debian.org/748918 (postgrey fails to start on Wheezy, fixed in Sid in November 2013, but unclear under which circumstances it shows up on Wheezy, too) Regards, Axel -- ,''`. | Axel Beckert a...@debian.org, http://people.debian.org/~abe/ : :' : | Debian Developer, ftp.ch.debian.org Admin `. `' | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE `-| 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#670681: /etc/init.d/postgrey script doesn't work properly
Control: severity 670681 serious Hello, FYI this totally broke greylisting for me after upgrading to wheezy and migrating to a new server as service postgrey restart did not restart the daemon and therefore did not apply the configuration changes I made which were necessary for a working postgrey installation. I am therefore upgrading the bug-severity (rationale makes the package in question unusable or mostly so). cu Andreas -- `What a good friend you are to him, Dr. Maturin. His other friends are so grateful to you.' `I sew his ears on from time to time, sure' -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#670681: /etc/init.d/postgrey script doesn't work properly
It seems like the start-stop-daemon uses /proc/pid/stat to find the matching process name like 'pgrep' does it. The man page of 'pgrep' describes the limitation: NOTES The process name used for matching is limited to the 15 characters present in the output of /proc/pid/stat. Use the -f option to match against the complete command line, /proc/pid/cmdline. For the postgrey init script this behaviour of start-stop-daemon renders it unusable. The only functions working is start and restart - that's not enough. So we can work around this like Nye Liu did. We even can completely ommit the --name option leaving the risk of killing the wrong process. Or we can just use postg as search pattern. start-stop-daemon does not expect the full path, it's just only able of recongnizing the first 15 characters (see pgrep limitation). The finest solution will be, if the start-stop-daemon could the able to match on /proc/pid/cmdline, like pgrep does if choosen the -f switch. Perhaps we should file another bug at the dpkg package? Searching for i just found one similiar bug: start-stop-daemon: --exec should also check the first argument of /proc/PID/cmdline https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=202719 But in the meanwhile the init script of postgrey should be fixed without relying on start-stop-daemosn limitations. regards, Matthias -- Matthias Wamser, Senior Systems Engineer, mailto: m...@ilk.net ILK Internet GmbH, Am Sandfeld 15, D-76149 Karlsruhe Tel: +49 (0) 721 9100 0, http://www.ilk.net Geschaeftsfuehrer Matthias Felger, AG Mannheim, HRB 107037 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#670681: /etc/init.d/postgrey script doesn't work properly
The patch supplied by Nye Liu fixes this issue for me on a system running Debian stable (wheezy). However, on another system which is updated to Debian testing (jessie) the startup script does not work at all - it just prints green [ok] but postgrey is actually not started! -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#670681: /etc/init.d/postgrey script doesn't work properly
Package: postgrey Version: 1.34-1.1 Followup-For: Bug #670681 Dear Maintainer, *** Please consider answering these questions, where appropriate *** Patch did not work for me. What worked was this change of init script: # line 80 - replaced --pidfile $PIDFILE --name $SSNAME # with --pidfile $PIDFILE -- System Information: Debian Release: 7.0 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 3.2.0-4-amd64 (SMP w/1 CPU core) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages postgrey depends on: ii adduser3.113+nmu3 ii debconf [debconf-2.0] 1.5.49 ii libberkeleydb-perl 0.51-1 ii libnet-dns-perl0.66-2+b2 ii libnet-server-perl 2.006-1 ii perl 5.14.2-21 ii ucf3.0025+nmu3 Versions of packages postgrey recommends: ii libnet-rblclient-perl 0.5-2 ii libparse-syslog-perl 1.10-2 ii postfix2.9.6-2 postgrey suggests no packages. -- Configuration Files: /etc/init.d/postgrey changed [not included] -- debconf information excluded -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#670681: /etc/init.d/postgrey script doesn't work properly
The patch supplied by Nye Liu fixes this issue for me, too. # dpkg -l | grep postgrey ii postgrey 1.34-1.1 all greylisting implementation for Postfix -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#670681: /etc/init.d/postgrey script doesn't work properly
I can verify that this patch has resolved my ability to reload postgrey after upgrading from Squeeze to Wheezy. (Thanks, Nye Liu!) It'd be great to see this patch get accepted (or this bug otherwise fixed, if the package maintainers know of a more correct way to resolve the issue). -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#670681: /etc/init.d/postgrey script doesn't work properly
Package: postgrey Version: 1.34-1.1 Severity: important Tags: patch /etc/init.d/postgrey passes --name to start-stop-daemon, but start-stop-daemon apparently expects a full path (/usr/sbin/postgrey vs postgrey) However, start-stop-daemon is also limited to 15 characters So stop/reload do NOT work at all. --- /etc/init.d/postgrey-dist 2012-04-27 16:58:30.0 -0700 +++ /etc/init.d/postgrey2012-04-27 17:05:53.0 -0700 @@ -23,6 +23,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/postgrey NAME=postgrey +SSNAME=`echo $DAEMON | cut -c -15` DESC=postfix greylisting daemon PIDFILE=/var/run/$NAME.pid @@ -51,7 +52,7 @@ start) log_daemon_msg Starting $DESC $NAME if start-stop-daemon --start --oknodo --quiet \ - --pidfile $PIDFILE --name $NAME \ + --pidfile $PIDFILE --name $SSNAME \ --startas $DAEMON -- $POSTGREY_OPTS $POSTGREY_TEXT_OPT then log_end_msg 0 @@ -63,7 +64,7 @@ stop) log_daemon_msg Stopping $DESC $NAME if start-stop-daemon --stop --oknodo --quiet \ - --pidfile $PIDFILE --name $NAME + --pidfile $PIDFILE --name $SSNAME then log_end_msg 0 else @@ -75,7 +76,7 @@ reload|force-reload) log_action_begin_msg Reloading $DESC configuration... if start-stop-daemon --stop --signal 1 --quiet \ - --pidfile $PIDFILE --name $NAME + --pidfile $PIDFILE --name $SSNAME then log_action_end_msg 0 else -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (x86_64) Kernel: Linux 3.2.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/dash Versions of packages postgrey depends on: ii adduser 3.102 Add and remove users and groups ii debconf [debconf-2.0] 1.5.39 Debian configuration management sy ii libberkeleydb-perl0.49-1 use Berkeley DB 4 databases from P ii libnet-dns-perl 0.66-2+b2 Perform DNS queries from a Perl sc ii libnet-server-perl0.94-1 An extensible, general perl server ii perl 5.14.2-9 Larry Wall's Practical Extraction ii ucf 3.007 Update Configuration File: preserv Versions of packages postgrey recommends: ii libnet-rblclient-perl 0.5-1 Queries multiple Realtime Blackhol ii libparse-syslog-perl 1.10-1 Perl module for parsing syslog ent ii postfix 2.9.1-4High-performance mail transport ag -- debconf information: postgrey/1.32-3_changeport: -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org