Bug 1628947
| Summary: | crm_resource's terminal handling is fishy | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Radek Steiger <rsteiger> |
| Component: | pacemaker | Assignee: | Ken Gaillot <kgaillot> |
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.6 | CC: | abeekhof, agk, cfeist, cluster-maint, fdinitto, kgaillot, lmiksik, oalbrigt, rsteiger |
| Target Milestone: | rc | Keywords: | Regression |
| Target Release: | 7.6 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | pacemaker-1.1.19-8.el7 | Doc Type: | No Doc Update |
| Doc Text: |
Not of interest to most end users
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-10-30 07:58:22 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1574898 | ||
|
Description
Radek Steiger
2018-09-14 13:23:39 UTC
This is a bizarre problem, but thankfully, it's someone else's problem ;-) It has something to do with the resource-agents package's ocf-shellfuncs library. The minimal reproducer is: --- cd /root cat >called.sh <<"EOF" #!/bin/sh . /usr/lib/ocf/lib/heartbeat/ocf-shellfuncs echo hello world exit 0 EOF chmod a+x called.sh --- (Being root lets the library create a trace file under /var/lib. You could probably set OCF_TRACE_FILE and run it as a regular user, but I wanted to show the minimal reproducer.) If you run the script interactively, with or without an action name, you get the expected output: --- # OCF_TRACE_RA=0 ./called.sh hello world # OCF_TRACE_RA=1 ./called.sh + 17:49:55: 3: echo hello world hello world + 17:49:55: 4: exit 0 # OCF_TRACE_RA=0 ./called.sh start hello world # OCF_TRACE_RA=1 ./called.sh start + 17:45:24: 3: echo hello world hello world + 17:45:24: 4: exit 0 --- If you call the script via ssh *without* an action name, you get the expected output, but if you call the script via ssh *with* an action name, you don't get trace output: --- % ssh root@rhel7-1 OCF_TRACE_RA=0 ./called.sh hello world % ssh root@rhel7-1 OCF_TRACE_RA=1 ./called.sh hello world + 17:48:21: 3: echo hello world + 17:48:21: 4: exit 0 % ssh root@rhel7-1 OCF_TRACE_RA=0 ./called.sh start hello world % ssh root@rhel7-1 OCF_TRACE_RA=1 ./called.sh start hello world --- That's as far as I investigated. The best solution will probably be to have crm_resource call the resource agent with a pseudo-terminal, so that ocf-shellfuncs sends log messages to stderr. Even if crm_resource is called from a script, it makes sense to log to stderr. Ping-ponging back to pacemaker. The latest plan is for crm_resource to set OCF_TRACE_FILE to /dev/stderr in the environment, which should make the ocf-shellfuncs library log to stderr without having to do pseudo-terminal gymnastics. Fixed in upstream 1.1 branch by commit d351a32 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:3055 |