Icinga / Icinga/docker-icinga2
Wrong directory permissions if first start has additional mounted files
@Al2Klimov is already working on this.
Since Jan 19, 2021.
- Dominant language
- Dockerfile
- Stars
- 73
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
if I start the container for the first time and I have additional files mounted (e.g. a IDO configuration file) the data directory got wrong permissions and Icinga 2 is not able to start. You have to first start the container without any additional file mounted, afterwards you can restart the container with additional mounted files.
The following docker-compose setup does not start.
version: "3.7"
volumes:
icinga-data:
services:
icinga-core:
image: icinga/icinga2:2.12.3
restart: unless-stopped
volumes:
- icinga-data:/data
- ./many.conf:/data/etc/icinga2/conf.d/many.conf
- ./ido-mysql.conf:/data/etc/icinga2/features-enabled/ido-mysql.conf
- ./api-users.conf:/data/etc/icinga2/conf.d/api-users.conf
Log:
icinga-core_1 | [2021-01-19 14:54:03 +0000] information/DockerEntrypoint: Initializing /data as we're the init pess (PID 1)
icinga-core_1 | [2021-01-19 14:54:03 +0000] information/DockerEntrypoint: Checking "/data/etc/icinga2"
icinga-core_1 | [2021-01-19 14:54:03 +0000] information/DockerEntrypoint: Checking "/data/var/cache/icinga2"
icinga-core_1 | [2021-01-19 14:54:03 +0000] information/DockerEntrypoint: Checking "/data/var/lib/icinga2"
icinga-core_1 | [2021-01-19 14:54:03 +0000] information/DockerEntrypoint: Checking "/data/var/log/icinga2"
icinga-core_1 | [2021-01-19 14:54:03 +0000] information/DockerEntrypoint: Checking "/data/var/run/icinga2"
icinga-core_1 | [2021-01-19 14:54:03 +0000] information/DockerEntrypoint: Checking "/data/var/spool/icinga2"
icinga-core_1 | [2021-01-19 14:54:03 +0000] information/DockerEntrypoint: Checking "/var/lib/icinga2/certs/ca.cr
icinga-core_1 | [2021-01-19 14:54:03 +0000] information/DockerEntrypoint: Looking up "dumb-init" in $PATH
icinga-core_1 | [2021-01-19 14:54:03 +0000] information/DockerEntrypoint: Running "/usr/bin/dumb-init"
icinga-core_1 | [2021-01-19 14:54:04 +0000] information/cli: Icinga application loader (version: v2.12.3)
icinga-core_1 | [2021-01-19 14:54:04 +0000] information/cli: Loading configuration file(s).
icinga-core_1 | [2021-01-19 14:54:04 +0000] critical/cli: Could not compile config files: Error: Function call '::ifstream::open' for file '/etc/icinga2/icinga2.conf' failed with error code 2, 'No such file or directory'
icinga-core_1 |
icinga-core_1 | (0) Compiling configuration file '/etc/icinga2/icinga2.conf'
icinga-core_1 |
Permissions:
# docker-compose exec icinga-core ls -lah /data/etc/icinga2
total 16K
drwxr-xr-x 4 root root 4.0K Jan 19 14:51 .
drwxr-xr-x 3 root root 4.0K Jan 19 14:51 ..
drwxr-xr-x 2 root root 4.0K Jan 19 14:51 conf.d
drwxr-xr-x 2 root root 4.0K Jan 19 14:51 features-enabled
The directory should be recursively owned by the icinga user and group.
It should be possible to start the container from the very beginning with mounted configuration files.
Best regards
Michael
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.