Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal: bind 127.0.0.1 port 25: Address already in use #90

Closed
rauchrob opened this issue Apr 14, 2015 · 2 comments
Closed

fatal: bind 127.0.0.1 port 25: Address already in use #90

rauchrob opened this issue Apr 14, 2015 · 2 comments

Comments

@rauchrob
Copy link

I have set up a couple of Ubuntu 14.04 machines with Postfix, simply by including this module without further parameters. The following Puppet run is succesful, but the postfix service is not running afterwards. There is an error message in /var/log/mail.err:

Apr 14 10:10:24 wsntbk13 postfix/master[22826]: fatal: bind 127.0.0.1 port 25: Address already in use

After the second Puppet run, everything works as expected.

@rauchrob
Copy link
Author

The problem probably is, that we are calling service postfix reload to restart Postfix on configuration changes. Appparently, this will not work in every case.

I'd suggest to do a hard restart (i.e. stop && start) on configuration changes per default, and additionally provide an Exec like, e.g.

exec { 'reload postfix configuration':
    command     => $::postfix::params::reload_cmd,
    refreshonly => true,
}

which can then be triggered from, e.g. puppet::files by adding correpsonding notify attributes to those File resources.

An even easier approch could be to do a hard restart, if we detect that a reload did not succeed.

@alexjfisher
Copy link
Member

I've run into the same problem on RHEL 6.6 with the following manifest

include ::augeas
class { 'postfix':
  satellite   => true,
  smtp_listen => '127.0.0.1',
  relayhost   => 'relayhost.example.com',
}

I have to run puppet twice for this manifest to work. There are no errors in the puppet logs, but the reload fails and after the puppet run is completed, the service is in a 'stopped' state. Below are the postfix logs.

Apr 29 13:45:11 mailhost postfix/postfix-script[12268]: refreshing the Postfix mail system
Apr 29 13:45:11 mailhost postfix/master[1506]: reload -- version 2.6.6, configuration /etc/postfix
Apr 29 13:45:11 mailhost postfix/master[1506]: warning: service 127.0.0.1:smtp: ignoring inet_interfaces change
Apr 29 13:45:11 mailhost postfix/master[1506]: warning: to change inet_interfaces, stop and start Postfix
Apr 29 13:45:11 mailhost postfix/master[1506]: fatal: bind 127.0.0.1 port 25: Address already in use

@rauchrob - Have you thought about creating a PR with one of your suggestions?

Thanks,
Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants