From 921595f75dc208457517095aeb1b727154a6ddc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Thu, 5 Nov 2020 22:18:43 +0100 Subject: [PATCH] Improve syslog detection This already limits it to /var/log/syslog --- app.go | 2 +- utils.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app.go b/app.go index 2f2d79f..911a8ae 100644 --- a/app.go +++ b/app.go @@ -132,7 +132,7 @@ func getConstraints() (constraints []string, err error) { fmt.Sprintf("syslog=%s", syslog), fmt.Sprintf("lsm=%s", lsm), ) - + glog.V(1).Info(fmt.Sprintf("The constraints are:, %s", constraints)) return constraints, nil } diff --git a/utils.go b/utils.go index a7d3f67..f60375a 100644 --- a/utils.go +++ b/utils.go @@ -52,7 +52,7 @@ func GetBootLoader() (boot string, err error) { } func GetSystemLogManager() (syslog string, err error) { - out, err := exec.Command("bash", "-c", "sudo lsof | grep /var/log/syslog | cut -f1 -d' '").Output() + out, err := exec.Command("bash", "-c", "sudo lsof +D /var/log | grep /var/log/syslog | cut -f1 -d' '").Output() if err != nil { out, err := exec.Command("bash", "-c", "service rsyslog status").Output() if err != nil {