Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1176162

Summary: rhqctl console does not handle signals correctly
Product: [JBoss] JBoss Operations Network Reporter: Larry O'Leary <loleary>
Component: Launch ScriptsAssignee: Michael Burman <miburman>
Status: CLOSED ERRATA QA Contact: Matt Mahoney <mmahoney>
Severity: medium Docs Contact:
Priority: unspecified    
Version: JON 3.2.3, JON 3.3.0CC: fbrychta, lzoubek, mmahoney, pyadav
Target Milestone: ER01Keywords: Triaged
Target Release: JON 3.3.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1174139 Environment:
Last Closed: 2015-04-30 16:10:42 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: 1174139    
Bug Blocks:    

Description Larry O'Leary 2014-12-19 15:22:23 UTC
Back-port this fix from upstream to JBoss ON 3.3 z-stream.

+++ This bug was initially created as a clone of Bug #1174139 +++

Description of problem: rhqctl does not catch operating system signals such as sigterm correctly. This causes rhqctl console to behave incorrectly and leave console software running on the background.


Version-Release number of selected component (if applicable): 4.13


How reproducible: Always.


Steps to Reproduce:
1.
2.
3.

Actual results: Only rhqctl dies from sigterm, not the software running on the console.


Expected results: sigterm should be sent to the underlying process also.


Additional info: These prevent some systemd / container / other supervisor support.

--- Additional comment from Michael Burman on 2014-12-15 10:58:39 EST ---

In PR #154

Comment 1 Michael Burman 2015-03-27 10:59:50 UTC
These need to be merged from master:

commit dbbae53dfdf2c31ca0761e36ed1afc108e0549d5
Merge: 10e36f9 d5da6ae
Author: Michael Burman <yak>
Date:   Tue Dec 16 16:24:27 2014 +0200

    Merge pull request #154 from burmanm/sigterm_branch
    
    Fixes rhq-agent.sh to work properly and returns the functionality of PR #149

commit 48507acad70ba89e16b7c3cd7ad1aa4b888373a3
Author: Michael Burman <miburman>
Date:   Mon Mar 9 15:40:58 2015 +0200

    [BZ 1174139] Fix starting script to work with FreeBSD also (and possibly some other sh-variants)

Comment 2 Michael Burman 2015-03-27 11:01:55 UTC
Also, the status of this update is that other supervisor methods still won't work in Unix variants (rhqctl can't track or those .sh files can't track kill signals properly). They haven't before either, so this doesn't break anything.

So these changes fix the behavior on Linux only (at least Fedora/RedHat sh - Ubuntu dash status unknown) and allow systemd to correctly monitor these.

Comment 3 Libor Zoubek 2015-04-01 17:24:53 UTC
branch:  release/jon3.3.x
link:    https://github.com/rhq-project/rhq/commit/7ba6e4c0f
time:    2015-04-01 19:24:06 +0200
commit:  7ba6e4c0ff1956c974ebe29a91259797cabbaaac
author:  Michael Burman - miburman
message: [BZ 1174139] Fix starting script to work with FreeBSD also (and possibly
         some other sh-variants)
         (cherry picked from commit
         48507acad70ba89e16b7c3cd7ad1aa4b888373a3) Signed-off-by: Libor
         Zoubek <lzoubek>

Comment 4 Michael Burman 2015-04-01 20:09:16 UTC
Only the latter patch was merged, without the first patches the starting scripts are broken.

Comment 5 Libor Zoubek 2015-04-01 21:15:30 UTC
all patches merged now

commit f4a606baefe5833ec7f2c227933c79706d1ae6bc
Author: Michael Burman <miburman>
Date:   Mon Mar 9 15:40:58 2015 +0200
    [BZ 1174139] Fix starting script to work with FreeBSD also (and possibly some other sh-variants)
    
    (cherry picked from commit 48507acad70ba89e16b7c3cd7ad1aa4b888373a3)
    Signed-off-by: Libor Zoubek <lzoubek>
commit 008d8366c01cc579e26abec6a9052d08a5cbf9b9
Author: Michael Burman <miburman>
Date:   Tue Dec 16 15:23:58 2014 +0200
    Fix whitespace issues
    
    (cherry picked from commit d5da6aee526110b813569ff2f38c952017e78dc2)
    Signed-off-by: Libor Zoubek <lzoubek>
commit 697aef25ac66ac0cafdbf49c9b97b279b050fc0b
Author: Michael Burman <miburman>
Date:   Mon Dec 15 17:58:05 2014 +0200
    [BZ 1174139] Fix SIGTERM handling for rhqctl console & rhqctl script
    
    (cherry picked from commit 9c79cdc6016559383b886f668c0bdaefa145bf41)
    Signed-off-by: Libor Zoubek <lzoubek>
commit c260cdaea77a5c1a94584fa84810b87bce70018d
Author: Michael Burman <miburman>
Date:   Mon Dec 15 10:11:19 2014 +0200
    Return veithen's rhq-server.sh part from #149
    
    (cherry picked from commit d116e76c2768508d0188276668a5c48e7f857087)
    Signed-off-by: Libor Zoubek <lzoubek>
:...skipping...
commit f4a606baefe5833ec7f2c227933c79706d1ae6bc
Author: Michael Burman <miburman>
Date:   Mon Mar 9 15:40:58 2015 +0200
    [BZ 1174139] Fix starting script to work with FreeBSD also (and possibly some other sh-variants)
    
    (cherry picked from commit 48507acad70ba89e16b7c3cd7ad1aa4b888373a3)
    Signed-off-by: Libor Zoubek <lzoubek>
commit 008d8366c01cc579e26abec6a9052d08a5cbf9b9
Author: Michael Burman <miburman>
Date:   Tue Dec 16 15:23:58 2014 +0200
    Fix whitespace issues
    
    (cherry picked from commit d5da6aee526110b813569ff2f38c952017e78dc2)
    Signed-off-by: Libor Zoubek <lzoubek>
commit 697aef25ac66ac0cafdbf49c9b97b279b050fc0b
Author: Michael Burman <miburman>
Date:   Mon Dec 15 17:58:05 2014 +0200
    [BZ 1174139] Fix SIGTERM handling for rhqctl console & rhqctl script
    
    (cherry picked from commit 9c79cdc6016559383b886f668c0bdaefa145bf41)
    Signed-off-by: Libor Zoubek <lzoubek>

commit c260cdaea77a5c1a94584fa84810b87bce70018d
Author: Michael Burman <miburman>
Date:   Mon Dec 15 10:11:19 2014 +0200

    Return veithen's rhq-server.sh part from #149
    
    (cherry picked from commit d116e76c2768508d0188276668a5c48e7f857087)
    Signed-off-by: Libor Zoubek <lzoubek>

commit 9d1c9b40848791c460f5860ad718269033b41170
Author: Michael Burman <miburman>
Date:   Fri Dec 12 17:15:47 2014 +0200

    [BZ 1172085] Start rhq-agent with exec to properly handle SIGTERM and allow console access
    
    (cherry picked from commit e96dc0719de6d8790c626a6e525c1806a9ead060)
    Signed-off-by: Libor Zoubek <lzoubek>

commit 4f8c17005ffbb469069c8f232f5395f640462af9
Author: Libor Zoubek <lzoubek>
Date:   Wed Apr 1 23:11:08 2015 +0200

    Revert "[BZ 1174139] Fix starting script to work with FreeBSD also (and possibly some other sh-variants)"
    
    This reverts commit 7ba6e4c0ff1956c974ebe29a91259797cabbaaac.

Comment 6 Simeon Pinder 2015-04-13 04:14:45 UTC
Moving to ON_QA for testing with latest cumulative patch build:
https://brewweb.devel.redhat.com//buildinfo?buildID=429507

Note: Build maps to JON 3.3.2 ER01 build.

Comment 11 errata-xmlrpc 2015-04-30 16:10:42 UTC
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://rhn.redhat.com/errata/RHSA-2015-0920.html