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

Fix mail notifications- update paths constructed from ConfigDir to match the v2.10 changes #336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hfinucane
Copy link
Contributor

I managed to really bobble this in #332- see the documentation for the warning about the new ConfigDir variable. Anything that uses it needs to be changed to be relative to SysconfDir+"/icinga2/"-

object NotificationCommand "mail-service-notification" {
-  command = [ SysconfDir + "/icinga2/scripts/mail-service-notification.sh" ]
+  command = [ ConfigDir + "/scripts/mail-service-notification.sh" ]

being the example diff. This will finish the transition in this cookbook.

Without this, if you use the examples, you will get errors in the logs that look like

terminated with exit code 128, output: execvpe(/etc/icinga2/icinga2/scripts/mail-service-notification.sh) failed: No such file or directory

and notifications will not work.

I managed to really bobble this- see [the
documentation](https://github.com/Icinga/icinga2/blob/master/doc/16-upgrading-icinga-2.md#path-constant-changes-)
for the warning about the new ConfigDir variable. Anything that uses it
needs to be changed to be relative to SysconfDir+"/icinga2/"-

```
object NotificationCommand "mail-service-notification" {
-  command = [ SysconfDir + "/icinga2/scripts/mail-service-notification.sh" ]
+  command = [ ConfigDir + "/scripts/mail-service-notification.sh" ]
```

being the example diff. This will finish the transition in this
cookbook.

Without this, if you use the examples, you will get errors in the logs
that look like
```
terminated with exit code 128, output: execvpe(/etc/icinga2/icinga2/scripts/mail-service-notification.sh) failed: No such file or directory
```

and notifications will not work.
ca_path 'ConfigDir + "/icinga2/pki/ca.crt"'
cert_path 'ConfigDir + "/pki/" + NodeName + ".crt"'
key_path 'ConfigDir + "/pki/" + NodeName + ".key"'
ca_path 'ConfigDir + "/pki/ca.crt"'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These paths have been deprecated in 2.8. While at it, think about a possible change here to /var/lib... as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/Icinga/icinga2/blob/master/doc/16-upgrading-icinga-2.md#upgrading-to-v28- oh shoot.

Icinga 2 automatically migrates the certificates to the new default location if they are configured and detected in /etc/icinga2/pki.

makes it sound like Icinga is papering over that under the covers, at least. I kind of want to address that in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has been sitting there, but likely not forever. Just wanted to mention it, thanks for taking care :)

@lippserd lippserd requested a review from vkhatri October 9, 2020 07:13
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 this pull request may close these issues.

2 participants