Fix TLS logic so containers can be started multiple times

This commit is contained in:
Rob Parker
2018-04-30 13:54:09 +01:00
parent 8eb937b8e0
commit 04bb404eee
2 changed files with 42 additions and 14 deletions

View File

@@ -51,10 +51,21 @@ func configureWebTLS(cms *KeyStore) error {
if err != nil {
return err
}
err = os.Rename(newTLSConfig, tlsConfig)
// we symlink here to prevent issues on restart
err = os.Symlink(newTLSConfig, tlsConfig)
if err != nil {
return err
}
mqmUID, mqmGID, err := command.LookupMQM()
if err != nil {
log.Error(err)
return err
}
err = os.Chown(tlsConfig, mqmUID, mqmGID)
if err != nil {
log.Error(err)
return err
}
return nil
}