mirror of
https://github.com/Icinga/docker-icinga2.git
synced 2025-11-09 19:31:35 +01:00
entrypoint: make /data a const for re-using
This commit is contained in:
parent
4a72040272
commit
097cec8d1f
@ -17,6 +17,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const dataVolume = "/data"
|
||||||
const ca = "/var/lib/icinga2/certs/ca.crt"
|
const ca = "/var/lib/icinga2/certs/ca.crt"
|
||||||
const crtMode = 0640
|
const crtMode = 0640
|
||||||
const mSmtpRc = "/var/lib/icinga2/.msmtprc"
|
const mSmtpRc = "/var/lib/icinga2/.msmtprc"
|
||||||
@ -36,10 +37,10 @@ func entrypoint() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if os.Getpid() == 1 {
|
if os.Getpid() == 1 {
|
||||||
logf(info, "Initializing /data as we're the init process (PID 1)")
|
logf(info, "Initializing %s as we're the init process (PID 1)", dataVolume)
|
||||||
|
|
||||||
for _, dir := range []string{"etc", "var/cache", "var/lib", "var/log", "var/run", "var/spool"} {
|
for _, dir := range []string{"etc", "var/cache", "var/lib", "var/log", "var/run", "var/spool"} {
|
||||||
dest := path.Join("/data", dir, "icinga2")
|
dest := path.Join(dataVolume, dir, "icinga2")
|
||||||
logf(info, "Checking %#v", dest)
|
logf(info, "Checking %#v", dest)
|
||||||
|
|
||||||
if _, errSt := os.Stat(dest); errSt != nil {
|
if _, errSt := os.Stat(dest); errSt != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user