I upgraded my Ubuntu 14.04 LTS to 16.04.1 LTS and now I have a problem with my postgrey installation. When I (re)boot the server, the postgrey startup script is apparently called but postgrey does not launch correctly. Only after manually restarting the service is postgrey working correctly.
In more detail: After reboot the following lines appear in my syslog:
Dec 1 19:22:14 systemd[1]: Starting LSB: Start/stop the postgrey daemon...
Dec 1 19:22:14 postgrey[998]: * Starting postfix greylisting daemon postgrey
Dec 1 19:22:15 postgrey[1050]: Process Backgrounded
Dec 1 19:22:15 postgrey[1050]: 2016/12/01-19:22:15 postgrey (type Net::Server::Multiplex) starting! pid(1050)
Dec 1 19:22:15 postgrey[998]: ...done.
Dec 1 19:22:15 systemd[1]: Started LSB: Start/stop the postgrey daemon.
When I then ps
for postgrey, no process is found. However, a simple sudo systemctl restart postgrey
makes it run properly. The launch is documented in syslog as follows:
Dec 1 19:25:54 systemd[1]: Stopping LSB: Start/stop the postgrey daemon...
Dec 1 19:25:54 postgrey[1878]: * Stopping postfix greylisting daemon postgrey
Dec 1 19:25:54 systemd[1]: postgrey.service: Control process exited, code=exited status=1
Dec 1 19:25:54 systemd[1]: Stopped LSB: Start/stop the postgrey daemon.
Dec 1 19:25:54 systemd[1]: postgrey.service: Unit entered failed state.
Dec 1 19:25:54 systemd[1]: postgrey.service: Failed with result 'exit-code'.
Dec 1 19:25:54 systemd[1]: Starting LSB: Start/stop the postgrey daemon...
Dec 1 19:25:54 postgrey[1886]: * Starting postfix greylisting daemon postgrey
Dec 1 19:25:54 postgrey[1886]: Pid_file "/var/run/postgrey.pid" already exists. Overwriting!
Dec 1 19:25:54 postgrey[1893]: Process Backgrounded
Dec 1 19:25:54 postgrey[1893]: 2016/12/01-19:25:54 postgrey (type Net::Server::Multiplex) starting! pid(1893)
Dec 1 19:25:54 postgrey[1886]: ...done.
Dec 1 19:25:54 systemd[1]: Started LSB: Start/stop the postgrey daemon.
Dec 1 19:25:54 postgrey[1893]: Resolved [localhost]:10023 to [::1]:10023, IPv6
Dec 1 19:25:54 postgrey[1893]: Resolved [localhost]:10023 to [127.0.0.1]:10023, IPv4
Dec 1 19:25:55 postgrey[1893]: Binding to TCP port 10023 on host ::1 with IPv6
Dec 1 19:25:55 postgrey[1893]: Binding to TCP port 10023 on host 127.0.0.1 with IPv4
Dec 1 19:25:55 postgrey[1893]: Setting gid to "120 120"
Dec 1 19:25:55 postgrey[1893]: Setting uid to "112"
As you can see, this time postgrey documents its binding to the correct port. When I look through my ps
output now, I can see the working process there. My question is: Why does the process not launch correctly when it is called at boot time? How can I pinpoint the error? I could not find any hints on what causes the error, so any advise regarding that might help me, too. Since it used to work in 14.04 and stopped working in 16.04, maybe it is related to upstart vs. systemd?
-d
option is usually wrong, but note that postgrey's mis-handling of plain old logging to standard error is a now four year old bug. – JdeBP Dec 09 '16 at 19:29