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)
Another note: pgrep is not available on all systems (e.g not on OS/X and probably also not on Solaris).
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]
please test this and provide details on why the agent cannot be restarted from cron.daily ... before making changes to these scripts.
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)
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.