Blame SOURCES/fix-logging-in-pcsd.patch

f40c32
From 0673479bb25bc000808465eae23d049804dc1415 Mon Sep 17 00:00:00 2001
f40c32
From: Tomas Jelinek <tojeline@redhat.com>
f40c32
Date: Thu, 21 Feb 2019 12:26:33 +0100
f40c32
Subject: [PATCH 2/3] fix logging in pcsd
f40c32
f40c32
Fix a bug causing most of the messages not being logged. Introduced
f40c32
in pcs-0.9.165 in commit 04d7e6a99beca700a2072406db671ef33d85c180.
f40c32
---
f40c32
 pcsd/bootstrap.rb | 4 ++++
f40c32
 1 file changed, 4 insertions(+)
f40c32
f40c32
diff --git a/pcsd/bootstrap.rb b/pcsd/bootstrap.rb
f40c32
index 0246c48b..035574b5 100644
f40c32
--- a/pcsd/bootstrap.rb
f40c32
+++ b/pcsd/bootstrap.rb
f40c32
@@ -67,11 +67,15 @@ if not defined? $cur_node_name
f40c32
 end
f40c32
 
f40c32
 def configure_logger(log_device)
f40c32
+  # Open the file ourselves so we can set its permissions for the case the file
f40c32
+  # does not exist. Logger is able to create and open the file for us but it
f40c32
+  # does not allow specifying file permissions.
f40c32
   if log_device.is_a?(String)
f40c32
     # File.open(path, mode, options)
f40c32
     # File.open(path, mode, perm, options)
f40c32
     # In order to set permissions, the method must be called with 4 arguments.
f40c32
     log_device = File.open(log_device, "a+", 0600, {})
f40c32
+    log_device.sync = true
f40c32
   end
f40c32
   logger = Logger.new(log_device)
f40c32
   if ENV['PCSD_DEBUG'] and ENV['PCSD_DEBUG'].downcase == "true" then
f40c32
-- 
f40c32
2.17.0
f40c32