Create /var/lib/icingaweb2

This commit is contained in:
Alexander A. Klimov 2021-06-28 16:02:27 +02:00
parent 101a4db635
commit 29513e761b
2 changed files with 6 additions and 3 deletions

View File

@ -28,6 +28,7 @@ RUN ["chmod", "-R", "u=rwX,go=rX", "/entrypoint-db-init"]
RUN ["chmod", "o+x", "/var/log/apache2"]
RUN ["chown", "www-data:www-data", "/var/run/apache2"]
RUN ["ln", "-vs", "/data/etc/icingaweb2", "/etc/icingaweb2"]
RUN ["ln", "-vs", "/data/var/lib/icingaweb2", "/var/lib/icingaweb2"]
RUN ["install", "-o", "www-data", "-g", "www-data", "-d", "/data"]
ENTRYPOINT ["/entrypoint"]

View File

@ -40,10 +40,12 @@ func entrypoint() error {
if os.Getpid() == 1 {
logf("info", "Initializing /data as we're the init process")
logf("debug", "Creating %#v", enModsDir)
if errMA := os.MkdirAll(enModsDir, dirMode); errMA != nil {
for _, dir := range []string{enModsDir, "/data/var/lib/icingaweb2"} {
logf("debug", "Creating %#v", dir)
if errMA := os.MkdirAll(dir, dirMode); errMA != nil {
return errMA
}
}
logf("debug", "Translating env vars to .ini config")