From 8b81062be0b47006c2717b96a25d8ae8a6bb1cbe Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 22 Sep 2014 14:53:07 -0400 Subject: [PATCH] The fix for gh-7284 causes problems for initscripts which have the standards compliant return codes but return a verbose error message via stdout. Limit the times when we invoke the heuristic to attempt to work around this. --- system/service | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/service b/system/service index 83fc2843c33..b235ee25c57 100644 --- a/system/service +++ b/system/service @@ -543,7 +543,10 @@ class LinuxService(Service): self.crashed = "crashed" in openrc_status_stderr # if the job status is still not known check it by status output keywords - if self.running is None: + # Only check keywords if there's only one line of output (some init + # scripts will output verbosely in case of error and those can emit + # keywords that are picked up as false positives + if self.running is None and status_stdout.count('\n') <= 1: # first transform the status output that could irritate keyword matching cleanout = status_stdout.lower().replace(self.name.lower(), '') if "stop" in cleanout: