Skip to content

Commit

Permalink
Don't fail if apparmor_parser is missing (#40)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
agners authored Oct 4, 2021
1 parent 565b0ee commit 342ae4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apparmor/apparmor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.]*)")
Expand Down

0 comments on commit 342ae4e

Please # to comment.