mirror of
https://github.com/containers/podman.git
synced 2025-06-19 00:06:43 +08:00
make --syslog errors non fatal
Podman will always pass down --syslog to conmon since 13c2aca21. However there systems without syslog running, likely in container setups. As reported in this was already a problem before when debug level is used. Then conmon will pass down --syslog back to the podman container cleanup command causing it to fail without doing anything. Given that I think it is better to just ignore the error and log it on debug level, we need to make sure cleanup works consistently. [NO NEW TESTS NEEDED] Fixes #19075 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -4,9 +4,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log/syslog"
|
||||
"os"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
logrusSyslog "github.com/sirupsen/logrus/hooks/syslog"
|
||||
@ -19,10 +17,8 @@ func syslogHook() {
|
||||
|
||||
hook, err := logrusSyslog.NewSyslogHook("", "", syslog.LOG_INFO, "")
|
||||
if err != nil {
|
||||
fmt.Fprint(os.Stderr, "Failed to initialize syslog hook: "+err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
if err == nil {
|
||||
logrus.Debug("Failed to initialize syslog hook: " + err.Error())
|
||||
} else {
|
||||
logrus.AddHook(hook)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user