You are not logged in.

#1 2013-05-27 22:25:22

dwheeler
Member
Registered: 2010-11-12
Posts: 21

[SOLVED] Latest postgrey is broke

On starting after the upgrade, I saw many instances of this:

May 27 15:02:33 systemd[1]: PID file /run/postgrey/postgrey.pid not readable (yet?) after start.
May 27 15:02:33 systemd[1]: postgrey.service never wrote its PID file. Failing.
May 27 15:02:33 systemd[1]: Failed to start Postfix Greylisting Service.
May 27 15:02:33 systemd[1]: Unit postgrey.service entered failed state.

After creating a dummy file:

May 27 15:01:13 postgrey[3119]: Use of uninitialized value $current_pid in pattern match (m//) at /usr/share/perl5/vendor_perl/Net/Server/Daemonize.pm line 48.
May 27 15:01:13 postgrey[3119]: Couldn't find pid in existing pid_file at /usr/share/perl5/vendor_perl/Net/Server/Daemonize.pm line 48.
May 27 15:01:13 postgrey[3119]: ERROR: Couldn't find pid in existing pid_file at /usr/share/perl5/vendor_perl/Net/Server/Daemonize.pm line 48.

After creating a dummy file with a fake PID:

May 27 15:03:21 postgrey[3176]: Pid_file "/run/postgrey/postgrey.pid" already exists.  Overwriting!
May 27 15:03:21 postgrey[3176]: Insecure dependency in unlink while running with -T switch at /usr/share/perl5/vendor_perl/Net/Server/Daemonize.pm line 64.
May 27 15:03:21 postgrey[3176]: ERROR: Insecure dependency in unlink while running with -T switch at /usr/share/perl5/vendor_perl/Net/Server/Daemonize.pm line 64.

It seems like the best thing for now is to revert to the previous version.

Last edited by dwheeler (2013-05-28 00:40:28)

Offline

#2 2013-05-27 22:31:04

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: [SOLVED] Latest postgrey is broke

Maybe systemd forgets to mount a writable tempfs to /run and /var/run during boot? Plymouth throws a pidfile warning, too. (Edit: It doesn't need it. Why does the service create one ...?)
I should formulate it better: Is the service loaded before the file system/ is remounted writable and with proper tempfs on /run?
Edit: Hmm, nope. The unit file looks ok.
Try to modify the systemd unit: Do not daemonize and don't use the pidfile:

[Unit]
Description=Postfix Greylisting Service
Before=postfix.service

[Service]
Type=simple
ExecStart=/usr/bin/postgrey --inet=127.0.0.1:10030 \
        --group=postgrey --user=postgrey \
        --greylist-text="Greylisted for %s seconds"
Restart=always
RestartSec=5
TimeoutSec=10

[Install]
WantedBy=multi-user.target

Last edited by progandy (2013-05-27 22:57:52)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2013-05-28 00:39:32

dwheeler
Member
Registered: 2010-11-12
Posts: 21

Re: [SOLVED] Latest postgrey is broke

progandy wrote:

Maybe systemd forgets to mount a writable tempfs to /run and /var/run during boot? Plymouth throws a pidfile warning, too. (Edit: It doesn't need it. Why does the service create one ...?)
I should formulate it better: Is the service loaded before the file system/ is remounted writable and with proper tempfs on /run?
Edit: Hmm, nope. The unit file looks ok.
Try to modify the systemd unit: Do not daemonize and don't use the pidfile:

Yep, according to logs, everything needed (filesystem-wise) is available at boot when postgrey is started - I also couldn't start it manually with systemctl. Reverting back wasn't an effective work-around either - the old version has the same issue now, so I suspect another package upgrade broke it. All that said, your suggestions for the systemd unit worked great with both versions, thanks!

Offline

Board footer

Powered by FluxBB