pkgsrc-Users archive

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

Issue with stopping the daemon postgrey (mail/postgrey), plus patch


I'm on NetBSD-8.1 amd64, using an updated pkgsrc stable, but the issue
arises with pkgsrc current as well.

The issue

Stopping the postgrey daemon ( service postgrey stop ) results in the
following error message in /var/log/maillog :

   Couldn't unlink "/var/run/" [Permission denied]

My diagnosis

The user/group postgrey doesn't have write permissions in /var/run .

My proposal

Create a directory postgrey in /var/run with the right permissions for
the user/group postgrey and place in this directory.

My proposed patch (tested; see below) modifies the rc.d file for
postgrey to create a directory postgrey in /var/run with the right
permissions for the user/group postgrey. This solves the original issue:
stopping the daemon postgrey now no longer results in an error message.

This solution is inspired by the rc.d file for mail/opendkim, which does
the same thing for opendkim. It's also inspired by a solution to the
same bug in Debian in 2012: see .

Thank you,

This is my proposed patch for the file mail/postgrey/files/ :

--- 2011-02-16 19:37:50.000000000 +0000
+++        2019-09-07 14:13:27.724033338 +0000
@@ -11,7 +11,7 @@
 command_args="-d --pidfile=${pidfile}"
@@ -21,6 +21,17 @@
 @PKGBASE@_flags=${@PKGBASE@_flags-"-i 2525"}
+       if [ ! -d @VARBASE@/run/postgrey ]; then
+               @MKDIR@ @VARBASE@/run/postgrey
+               @CHMOD@ 0750 @VARBASE@/run/postgrey
+               @CHOWN@ @POSTGREY_USER@:@POSTGREY_GROUP@ @VARBASE@/run/postgrey
+       fi
 stop_postcmd='rm -f $pidfile'
 load_rc_config $name

Home | Main Index | Thread Index | Old Index