FS#29396 - [postgrey] init script issues: pid permissions, greylist text

Attached to Project: Community Packages
Opened by Jacob Joseph (jacobjjoseph.org) - Wednesday, 11 April 2012, 20:34 GMT
Last edited by Sergej Pupykin (sergej) - Monday, 16 April 2012, 09:49 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Hi.
I've noticed some issues with the postgrey init script.

Most notably, it attempts to write /run/postgrey.pid as the user running postgrey. My /run doesn't have world-write permissions, so this fails, and the PID file is never written. As a result, it is not possible to stop or restart postgrey using the init script. Moving the pid file to /run/postgrey/postgrey.pid, and creating /run/postgrey with correct ownership in the init script works well. For example:

----------
PIDFILE=/var/run/postgrey/postgrey.pid

[[ -d /var/run/postgrey ]] || mkdir -p /var/run/postgrey
chown postgrey:postgrey /var/run/postgrey

PID=`cat $PIDFILE 2>/dev/null`
[ -d /proc/$PID ] || PID=""
----------

A second issue is that I can't get quoting to work right when the --greylist-text= option is set in $POSTGREY_OPTS inside /etc/conf.d/postgrey. I haven't had success setting a message that contains spaces, and have tried much escaping of quotes and spaces. Surely there's a means of making this work. If so, I'd like to know how, and this should be indicated in the comments of the configuration file.

I know Gentoo had similar issues with quoting. They solved it by using a $POSTGREY_TEXT variable to the config file, and using it directly in the init script. This works well for me:

------
[ -z "$PID" ] && $POSTGREY_BIN --daemonize --$POSTGREY_ADDR \
--group=$GROUP --user=$USER $POSTGREY_OPTS --pidfile=$PIDFILE \
--greylist-text="$POSTGREY_TEXT" > /dev/null
------

Thanks.
~Jacob
This task depends upon

Closed by  Sergej Pupykin (sergej)
Monday, 16 April 2012, 09:49 GMT
Reason for closing:  Fixed
Comment by Alexander F. Rødseth (xyproto) - Thursday, 12 April 2012, 05:07 GMT
Hi, which package is this bug report for?
Comment by Jacob Joseph (jacobjjoseph.org) - Thursday, 12 April 2012, 05:19 GMT Comment by Alexander F. Rødseth (xyproto) - Friday, 13 April 2012, 06:28 GMT
Thanks. I missed it when searching for the package, for some reason.

Loading...