Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 258963 - mail-filter/postgrey - /etc/init.d/postgrey shows postgrey as "crashed" under openrc-0.4.3
Summary: mail-filter/postgrey - /etc/init.d/postgrey shows postgrey as "crashed" under...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-14 12:11 UTC by Ian Pickworth
Modified: 2009-05-21 08:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix status report under openrc-0.4.3 (t.patch,420 bytes, text/plain)
2009-02-14 12:15 UTC, Ian Pickworth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Pickworth 2009-02-14 12:11:48 UTC
ian2 ~ # rc-status
Runlevel: default
... snip ....
 postgrey                                                          [  crashed  ]
... snip ....

Also:
ian2 ~ # /etc/init.d/postgrey status
* status: crashed

But:
ian2 ~ # ps -ef | grep postgrey
postgrey   841     1  0 11:32 ?        00:00:00 /usr/sbin/postgrey --inet=127.0.0.1:10030 --daemonize --pidfile=/var/run/postgrey.pid --delay=300 --greylist-text=Greylisted for %s seconds



Reproducible: Always

Steps to Reproduce:
1./etc/init.d/postgrey start
2./etc/init.d/postgrey status




Expected Results:  
/etc/init.d/postgrey status
should show status as "started"

I dug around using strace, and I found that the "start()" part of 
/etc/init.d/postgrey
so that start-stop-daemon includes a --pidfile=${POSTGREY_PID} entry before
the --exec /usr/sbin/postgrey parameter solves the problem.

A patch to make this change is as follows:

--- /mnt/root-copy/etc/init.d/postgrey	2007-11-15 17:25:50.000000000 +0000
+++ /etc/init.d/postgrey	2009-02-14 11:59:34.000000000 +0000
@@ -75,7 +75,7 @@
 		POSTGREY_TEXT_ARG="--greylist-text=${POSTGREY_TEXT}"
 	fi
 
-	start-stop-daemon --start --quiet --background \
+	start-stop-daemon --start --quiet --background --pidfile=${POSTGREY_PID} \
 		--exec /usr/sbin/postgrey -- \
 		--${POSTGREY_ADDR} \
 		--daemonize \
Comment 1 Ian Pickworth 2009-02-14 12:15:32 UTC
Created attachment 181996 [details]
Patch to fix status report under openrc-0.4.3

Attached patch to /etc/init.d/postgrey as a file.
Comment 2 Ian Pickworth 2009-02-14 12:29:32 UTC
I have tested the patch on a Gentoo installation that is still running 
baselayout-1.12.11.1
and it works there as well without causing any other side effects as far as I can tell.
Comment 3 Tobias Scherbaum (RETIRED) gentoo-dev 2009-05-21 05:59:31 UTC
(In reply to comment #0)
> Reproducible: Always
> 
> Steps to Reproduce:
> 1./etc/init.d/postgrey start
> 2./etc/init.d/postgrey status

# /etc/init.d/postgrey start
* Starting Postgrey...                                                                                                                                   [ ok ]
# ps axf|grep postgrey
18471 ?        Ss     0:00 /usr/sbin/postgrey --inet=127.0.0.1:10030 --daemonize --pidfile=/var/run/postgrey.pid --delay=300 --greylist-text=Greylisted for %s seconds
# /etc/init.d/postgrey status
* status: started

[ebuild   R   ] sys-apps/openrc-0.4.3-r2  USE="ncurses pam unicode -debug" 143 kB


So, can you please re-test this with latest openrc? (If it's still an error for you, well re-open this bugreport please!) Thanks!
Comment 4 Ian Pickworth 2009-05-21 07:37:53 UTC
I have tested with the following versions:

[ebuild   R   ] sys-apps/openrc-0.4.3-r2  USE="ncurses pam unicode -debug"
[ebuild   R   ] mail-filter/postgrey-1.32  USE="-targrey"

test:
ian2 ~ # /etc/init.d/postgrey status
* status: started

Problem solved :-)
Many thanks
Regards
Ian
Comment 5 Tobias Scherbaum (RETIRED) gentoo-dev 2009-05-21 08:27:14 UTC
(In reply to comment #4)
> test:
> ian2 ~ # /etc/init.d/postgrey status
> * status: started
> 
> Problem solved :-)

cool!