Icinga / docker-icinga2

Official Icinga 2 Docker images
GNU General Public License v2.0
66 stars 30 forks source link

Enable systemd integration #103

Closed t-8ch closed 9 months ago

t-8ch commented 1 year ago

podman is able to pass systemd notification sockets through to the containerized application. By enabling the systemd integration in icinga2 the host systemd is able to see the runtime status of the containerized icinga2 instance, especially for startup notifications.

libsystemd is already installed in the base image so no new runtime dependency is introduced.

cla-bot[bot] commented 1 year ago

Thank you for your pull request. Before we can look at it, you'll need to sign a Contributor License Agreement (CLA).

Please follow instructions at https://icinga.com/company/contributor-agreement to sign the CLA.

After that, please reply here with a comment and we'll verify.

Contributors that have not signed yet: @t-8ch

- If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Please [contact us](https://icinga.com/company/contact/) if you think this is the case. - If you signed the CLA as a corporation, your GitHub username may not have been submitted to us. Please reach out to the responsible person in your organization.
bobapple commented 1 year ago

@cla-bot check

t-8ch commented 1 year ago

Please install it explicitly

Done

t-8ch commented 1 year ago

With this changeset it's possible to use the container as a Type=notify systemd service in combination with podman:

# icinga.service
[Service]
Type=notify
ExecStart=/usr/bin/podman run --name icinga --sdnotify container docker.io/icinga/icinga2

[Install]
WantedBy=default.target

This service will only be marked as ready when icinga2 from within the container has signalled its completed startup. This makes it possible to order other systemd services properly in relation to the icinga container. We want to use it to perform some post-start tasks that need the container to be properly started.