From 46465b9b771ae4175b45d9291be6ce2b1f998ab1 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Mon, 4 Oct 2021 18:32:22 +0200 Subject: [PATCH] Don't fail if apparmor_parser is missing Currently a missing apparmor_parser binary leads to a panic at startup already since the property value gets evaluated when the propery is registred. Set the property to an empty string if apparmor_parser is missing. This will allow to generate a sensible warning in Supervisor so the user can act on it. --- apparmor/apparmor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apparmor/apparmor.go b/apparmor/apparmor.go index 83f4175..fa33ce4 100644 --- a/apparmor/apparmor.go +++ b/apparmor/apparmor.go @@ -27,7 +27,8 @@ func getAppArmorVersion() string { out, err := cmd.CombinedOutput() if err != nil { - logging.Critical.Panic(err) + logging.Warning.Print(err) + return string("") } re := regexp.MustCompile("version ([0-9.]*)")