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

Postfix doesn't reload when settings change #7

Closed
Yggdrasil opened this issue Oct 25, 2018 · 3 comments
Closed

Postfix doesn't reload when settings change #7

Yggdrasil opened this issue Oct 25, 2018 · 3 comments

Comments

@Yggdrasil
Copy link

First of all, thanks for this useful module!

I noticed postfix isn't reloaded or restarted after some settings have changed.

This is on Ubuntu 14.04 with Puppet 4.10 and Hiera 5.
Version 1.0.1 of the oxc-postfix module, configure via Hiera.

At first I though that perhaps service_manage was disabled, but according to Hiera lookup it definitely is 'true' and the restart_cmd is set correctly for Ubuntu.

$ sudo /opt/puppetlabs/bin/puppet lookup 'postfix::service_manage' --environment=production --node=i-046a905500cd5973f.www15.eu-west-1
--- true
$ sudo /opt/puppetlabs/bin/puppet lookup 'postfix::restart_cmd' --environment=production --node=i-046a905500cd5973f.www15.eu-west-1
--- "/etc/init.d/postfix reload"

The agent's debug logs shows there's a refresh event propagated but appears it's never acted upon.

Notice: /Stage[main]/Postfix::Config/Postconf[compatibility_level]/ensure: created
Debug: Executing: '/usr/sbin/postconf compatibility_level=2'
Debug: /Stage[main]/Postfix::Config/Postconf[compatibility_level]: The container Class[Postfix::Config] will propagate my refresh event
Debug: Class[Postfix::Config]: The container Stage[main] will propagate my refresh event
Debug: Service[postfix](provider=upstart): Could not find postfix.conf in /etc/init
Debug: Service[postfix](provider=upstart): Could not find postfix.conf in /etc/init.d
Debug: Service[postfix](provider=upstart): Could not find postfix in /etc/init
Debug: Executing: '/usr/sbin/service postfix status'

Here's another example from puppet agent -t. Some obvious changes, but no reload.

Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for i-046a905500cd5973f.www15.eu-west-1
Info: Applying configuration version 'puppet-production-054ed3c5531'
Notice: /Stage[main]/Postfix::Config/Postconf[config_directory]/ensure: removed
Notice: /Stage[main]/Postfix::Config/Postconf[compatibility_level]/ensure: created
Notice: Applied catalog in 21.48 seconds

I haven't looked into this in detail yet, shouldn't the relationship between the postfix::config and postfix::service classes have a notify "~>" instead of a require "->"?

So in init.pp:

Class { '::postfix::package':  }
-> Class { '::postfix::config': }
-> Class { '::postfix::service': }

should become:

Class { '::postfix::package':  }
-> Class { '::postfix::config': }
~> Class { '::postfix::service': }

Let me know what you think please?

@oxc
Copy link
Collaborator

oxc commented Oct 25, 2018

This sounds about right, nice catch. Looks like the relation is a left-over from the original project this module was forked from.
@Yggdrasil, would you mind providing a pull request?

@Yggdrasil
Copy link
Author

There you go!

@oxc oxc closed this as completed in 615b98e Oct 28, 2018
oxc added a commit that referenced this issue Oct 28, 2018
The config package did not have a notify-relationship to the service
package. This patch fixes this, causing postfix to get reloaded and
picking up the new config upon changes.

Patch provided by Martijn Heemels (see #8).

Fixes #7.
@Yggdrasil
Copy link
Author

Yggdrasil commented Oct 28, 2018

Thanks @oxc! I appreciate the new release you made so I can start using it right away.

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

Successfully merging a pull request may close this issue.

2 participants