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

Bug 831632

Summary: [RFE] Better kill patch for JON agent re-start scripts
Product: [JBoss] JBoss Operations Network Reporter: Shaun Appleton <sappleto>
Component: AgentAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED WONTFIX QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: JON 3.0.0CC: belaran, hrupp, loleary, myarboro, tfonteyn
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-11 20:52:33 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
better kill patch from case 00610945 none

Description Shaun Appleton 2012-06-13 13:30:28 UTC
Created attachment 591502 [details]
better kill patch from case 00610945

Description of problem:
In case 00610945 the JON agent re-start scripts failed when using cron.daily.
The result was that the script were re-written.

Attached is the resulting patch.

(Patch was written by Romain Pelisse whilst on site)

Comment 2 Heiko W. Rupp 2012-06-15 12:39:19 UTC
Another note: pgrep is not available on all systems (e.g not on OS/X and probably also not on Solaris).

Comment 3 Tom Fonteyne 2012-06-15 12:54:24 UTC
double checked, Solaris 10 (and 11) have pgrep, here is it with all options:

/usr/bin/pgrep

Usage: pgrep [-flnovx] [-d delim] [-P ppidlist] [-g pgrplist] [-s sidlist]
        [-u euidlist] [-U uidlist] [-G gidlist] [-J projidlist]
        [-T taskidlist] [-t termlist] [-z zonelist] [-c ctidlist] [pattern]

Comment 4 Mike Foley 2012-06-18 15:47:26 UTC
please test this and provide details on why the agent cannot be restarted from cron.daily ... before making changes to these scripts.

Comment 8 Romain PELISSE 2012-06-29 09:49:37 UTC
From my point o view, changing the script is NOT to fix the crontab issue - the root cause of this issue has never been really identified. The point of those changes is to make the "kill/process" of the agent more consistent through the script, and also a bit more "UNIX friendly".
 
I know that most shell script for JBoss product are "ugly" mostly to ensure backward compatibility with all the Unixes (Solaris being one), but there is no supported Unix that doesn't support pgrep, I think it is a good move to move forward with those changes. (IMHO)

Comment 10 Larry O'Leary 2013-10-11 20:52:33 UTC
There have been some changes to the agent process life-cycle. I am not certain why the script changes suggested here were needed in the first place but the latest scripts (expected for 3.2) are working in the same manner as the POSIX recommendations for process termination state. 

As the solution provided in the recommended patch is platform specific it seems to introduce too much risk in cross-platform compatibility.

If the original issue is re-experienced, I suggest that Red Hat Global Support Services re-investigate in the context of the latest versions of the scripts. If a change is needed as an enhancement or feature request, we should use the JBoss ON RFE process.