summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Morrison <jake@cogini.com>2016-12-16 13:28:06 +0800
committerBrian Coca <brian.coca+git@gmail.com>2016-12-16 12:28:55 -0500
commitcfbb58adaeb3a7814667dbdc18272bffff5f8ef8 (patch)
treee7e703e818b08371e8adcad1f2edfa5c320bd4e9
parentf90a6439c41c345f48ea4187278ba39dbdb182e3 (diff)
downloadansible-cfbb58adaeb3a7814667dbdc18272bffff5f8ef8.tar.gz
Handle inability to read /proc for ansible_service_mgr. Fixes #18957
(cherry picked from commit 00859a4ced88c23d2c62ef0a0c86705767df3954)
-rw-r--r--lib/ansible/module_utils/facts.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index 94b94aa695..9ca8fed850 100644
--- a/lib/ansible/module_utils/facts.py
+++ b/lib/ansible/module_utils/facts.py
@@ -328,6 +328,10 @@ class Facts(object):
else:
proc_1 = os.path.basename(proc_1)
+ # The ps command above may return "COMMAND" if the user cannot read /proc, e.g. with grsecurity
+ if proc_1 == "COMMAND\n":
+ proc_1 = None
+
if proc_1 is not None:
proc_1 = to_native(proc_1)
proc_1 = proc_1.strip()