mirror of
https://github.com/Icinga/docker-icingaweb2.git
synced 2025-10-24 05:21:00 +02:00
entrypoint: make /data a const for re-using
This commit is contained in:
parent
a5db4d9f7c
commit
39971df6fa
@ -18,10 +18,12 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const confDir = "/data/etc/icingaweb2"
|
||||
const dataVolume = "/data"
|
||||
const modsDir = "/usr/share/icingaweb2/modules"
|
||||
const dirMode = 0750
|
||||
|
||||
var confDir = path.Join(dataVolume, "etc", "icingaweb2")
|
||||
|
||||
var enModsDir = path.Join(confDir, "enabledModules")
|
||||
|
||||
func main() {
|
||||
@ -38,9 +40,9 @@ func entrypoint() error {
|
||||
}
|
||||
|
||||
if os.Getpid() == 1 {
|
||||
logf("info", "Initializing /data as we're the init process")
|
||||
logf("info", "Initializing %s as we're the init process", dataVolume)
|
||||
|
||||
for _, dir := range []string{enModsDir, "/data/var/lib/icingaweb2"} {
|
||||
for _, dir := range []string{enModsDir, path.Join(dataVolume, "var", "lib", "icingaweb2")} {
|
||||
logf("debug", "Creating %#v", dir)
|
||||
if errMA := os.MkdirAll(dir, dirMode); errMA != nil {
|
||||
return errMA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user