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.000000000 -0700 > +++ /etc/init.d/postgrey 2012-04-27 17:05:53.000000000 -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-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org