mirror of
https://github.com/Icinga/docker-icingaweb2.git
synced 2025-10-23 13:00:59 +02:00
entrypoint: don't consider chown failure critical
as volumes may be mounted read-only.
This commit is contained in:
parent
43b34b05d0
commit
37fc5ea78f
@ -44,16 +44,18 @@ func entrypoint() error {
|
||||
if os.Getuid() == 0 {
|
||||
logf("info", "Giving %s to the www-data user as we're root", dataVolume)
|
||||
|
||||
err := filepath.WalkDir(dataVolume, func(path string, _ fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
_ = filepath.WalkDir(dataVolume, func(path string, _ fs.DirEntry, err error) error {
|
||||
if err == nil {
|
||||
err = os.Lchown(path, wwwdataUid, wwwdataUid)
|
||||
}
|
||||
|
||||
return os.Lchown(path, wwwdataUid, wwwdataUid)
|
||||
if err != nil {
|
||||
logf("warn", "Can't chown %s: %s", path, err.Error())
|
||||
return filepath.SkipDir
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
logf("info", "Dropping privileges as we're root")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user