On 30.06.2016 12:07, Petr Spacek wrote:
On 30.6.2016 10:21, Jan Cholasta wrote:
On 30.6.2016 10:12, Petr Spacek wrote:
On 30.6.2016 10:14, Jan Cholasta wrote:
On 30.6.2016 10:06, Petr Spacek wrote:
On 30.6.2016 10:02, Jan Cholasta wrote:
On 30.6.2016 09:56, Petr Spacek wrote:
On 30.6.2016 09:40, Martin Basti wrote:
https://fedorahosted.org/freeipa/ticket/5757
"The easiest solution would be to add timestamps to logs, or log to
different
logs from oddjob or from installer (ipareplica-conncheck.local.log and
ipareplica-conncheck.remote.log)"

Actually the easiest solution would be not to log into a file when executed
from oddjob.
Well, IPA is hard enough to debug even with logs. I would not make situation
even worse by not logging at all :-)
The commands logs into stderr, and both stdout and stderr are sent back to the
caller of the oddjob.

Alternatively, it could log into a different file (say
/var/log/ipareplica-conncheck-oddjob.log). IMO timestamps are an overkill to
fix this bug.
When we are at it, a custom logger is overkill. IMHO we should log everything
to journal and be done with it ...
It's not, we want to log to at least stderr ourselves.

Also, it would be even harder to implement than timestamps, and time is a
Sure, we do not have time:
=> ACK for current version of the patch.

Petr^2 Spacek

factor here. It would fit more into
<https://fedorahosted.org/freeipa/ticket/4501>.

Petr^2 Spacek

Patches attached.
I would rather use timestamp format with dashes between numbers to make it
easier to read and parse for humans.

Compare:

201606270954
201606290954
201606300954

with

2016-06-27-09-54
2016-06-29-09-54
2016-06-30-09-54




New patches attaches
From f3c1532fd4415ab6786e5290b73b272648fd8dc2 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Thu, 30 Jun 2016 11:21:34 +0200
Subject: [PATCH 1/2] Add option --no-log for ipa-replica-conncheck script

When option is sued, ipa-replica-conncheck will not log into file

https://fedorahosted.org/freeipa/ticket/5757
---
 install/tools/ipa-replica-conncheck | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/install/tools/ipa-replica-conncheck b/install/tools/ipa-replica-conncheck
index e308b118f20306107bc62eba2a60187fbc52f4fc..6f69cc81517299f8cf8decef7c79f7de682d0c80 100755
--- a/install/tools/ipa-replica-conncheck
+++ b/install/tools/ipa-replica-conncheck
@@ -181,6 +181,8 @@ def parse_options():
     parser.add_option("-q", "--quiet", dest="quiet",
                       action="store_true",
                       default=False, help="Output only errors")
+    parser.add_option("--no-log", dest="log_to_file", action="store_false",
+                      default=True, help="Do not log into file")
 
     options, args = parser.parse_args()
     safe_options = parser.get_safe_opts(options)
@@ -212,7 +214,7 @@ def parse_options():
 def logging_setup(options):
     log_file = None
 
-    if os.getegid() == 0:
+    if os.getegid() == 0 and options.log_to_file:
         log_file = paths.IPAREPLICA_CONNCHECK_LOG
 
     standard_logging_setup(log_file, debug=options.debug)
-- 
2.5.5

From 48e919d87f7490ddcdf7c60a57bdd93a5bdf1ea4 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Thu, 30 Jun 2016 11:22:31 +0200
Subject: [PATCH 2/2] Do not log to file in remote conncheck side

https://fedorahosted.org/freeipa/ticket/5757
---
 install/oddjob/org.freeipa.server.conncheck | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/install/oddjob/org.freeipa.server.conncheck b/install/oddjob/org.freeipa.server.conncheck
index ab7a46a86d5e3dbf54efa51c82656485a3030f26..9d57ea26e078d7d04f493fd4ce6b18330fd69325 100755
--- a/install/oddjob/org.freeipa.server.conncheck
+++ b/install/oddjob/org.freeipa.server.conncheck
@@ -1,2 +1,2 @@
 #!/bin/sh
-exec /usr/sbin/ipa-replica-conncheck --replica "$1" 2>&1
+exec /usr/sbin/ipa-replica-conncheck --no-log --replica "$1" 2>&1
-- 
2.5.5

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to