From a37cd5efa8d27ece7d86a6aadee4b3f590d928b3 Mon Sep 17 00:00:00 2001 From: SteelPhase Date: Wed, 10 May 2017 08:15:22 -0400 Subject: [PATCH] Update linux upstart detection to support RHEL6 (#92) * Update linux upstart detection to support RHEL6 I've added additional detection logic to the isUpstart function, that should validate the existence of upstart on a RHEL 6 system. * Remove debug message --- service_upstart_linux.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/service_upstart_linux.go b/service_upstart_linux.go index 04120a4..e4c4871 100644 --- a/service_upstart_linux.go +++ b/service_upstart_linux.go @@ -17,6 +17,13 @@ func isUpstart() bool { if _, err := os.Stat("/sbin/upstart-udev-bridge"); err == nil { return true } + if _, err := os.Stat("/sbin/init"); err == nil { + if out, err := exec.Command("/sbin/init", "--version").Output(); err == nil { + if strings.Contains(string(out),"init (upstart") { + return true + } + } + } return false }