Bug 1328146 - [GSS](6.4.z) Start-up script jboss-as-standalone.sh does not work on RHEL 5 OS
Summary: [GSS](6.4.z) Start-up script jboss-as-standalone.sh does not work on RHEL 5 OS
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Scripts and Commands
Version: 6.4.4
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: CR1
: EAP 6.4.16
Assignee: Miroslav Sochurek
QA Contact: Peter Mackay
URL:
Whiteboard:
Depends On:
Blocks: eap6416-payload
TreeView+ depends on / blocked
 
Reported: 2016-04-18 15:04 UTC by Paramvir jindal
Modified: 2019-10-10 11:54 UTC (History)
13 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-06-22 09:23:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEAP-4590 0 Major Closed wildfly-init-redhat.sh and jboss-eap-rhel.sh scripts do not work on RHEL 5 OS 2018-08-14 12:43:57 UTC
Red Hat Issue Tracker WFCORE-1550 0 Major Resolved wildfly-init-redhat.sh script does not work on RHEL 5 OS 2018-08-14 12:43:57 UTC

Description Paramvir jindal 2016-04-18 15:04:12 UTC
Description of problem:

EAP 6.4.4 start-up script $JBOSS_HOME/bin/init.d/jboss-as-standalone.sh tries to get successful start timestamp using following command:

grep -o '[0-9]*' $JBOSS_MARKERFILE

This however does not work on RHEL 5 OS, as grep-2.5.1 does not return regular expression result correctly when used with -o option.

Version-Release number of selected component (if applicable):
 
JBoss EAP 6.4 CP04 bring this change in the script that is not working properly.


How reproducible:

Everytime

Steps to Reproduce:
1. 
2.
3.

Actual results:


Expected results:


Additional info:

As a temporary workaround, regular expression can be modified and script then works as expected. Here is an example of such workaround command:

grep -o '[0-9]\+' $JBOSS_MARKERFILE

Comment 1 Paramvir jindal 2016-04-18 15:06:15 UTC
So here is the meaning of the regular expressions:

       -o, --only-matching
              Print only the matched (non-empty) parts of a matching line,  with  each  such
              part on a separate output line.

   Repetition

       *      The preceding item will be matched zero or more times.
       +      The preceding item will be matched one or more times.

I tried testing grep with -o option with both the regular expressions on RHEL5 as well as RHEL6 and RHEL7. Definitely there are differences and 

See the following.

For RHEL5:

	[root@rhel5 ~]# cat testrhel5 
	pushpendra
	01042016
	082236
	12345678
	90876abcd
	chavantest123
	linux4you
	[root@rhel5 ~]# grep -o '[0-9]*' testrhel5
	01042016
	082236
	12345678
	90876



For RHEL6:

	[root@rhel6 ~]# cat testrhel6
	pushpendra
	01042016
	082236
	12345678
	90876abcd
	chavantest123
	linux4you
	[root@rhel6 ~]# grep -o '[0-9]*' testrhel6 
	01042016
	082236
	12345678
	90876
	123
	4

For RHEL7:

	[root@rhel7 ~]# cat testrhel7 
	pushpendra
	01042016
	082236
	12345678
	90876abcd
	chavantest123
	linux4you
	[root@rhel7 ~]# grep -o '[0-9]*' testrhel7
	01042016
	082236
	12345678
	90876
	123
	4


Whereas for all RHEL5/6/7, we get same output for following regular expression.

	[root@rhel5 ~]# grep -o '[0-9]\+' testrhel5
	01042016
	082236
	12345678
	90876
	123
	4
	[root@rhel6 ~]# grep -o '[0-9]\+' testrhel6 
	01042016
	082236
	12345678
	90876
	123
	4
	[root@rhel7 ~]# grep -o '[0-9]\+' testrhel7
	01042016
	082236
	12345678
	90876
	123
	4

Comment 3 Chao Wang 2016-05-13 07:51:46 UTC
This deserves an upstream fix and also in jboss-as-domain.sh

Comment 4 Vlado Pakan 2016-05-13 15:04:47 UTC
Thanks for noticing this. Original PR is updated and additional PRs are created

Comment 5 JBoss JIRA Server 2016-06-14 08:31:23 UTC
Vlado Pakan <vpakan> updated the status of jira JBEAP-4590 to Resolved

Comment 8 Ivo Hradek 2017-06-07 09:07:30 UTC
Workaround is working as expected hence verified for EAP-6.4.16-CP.CR1;

Note: Mentioned change in behavior was introduced in `grep-2.5.3`

Comment 9 Petr Penicka 2017-06-22 09:23:50 UTC
Released on June 20 2017 as part of the EAP 6.4.16 maintenance release.


Note You need to log in before you can comment on or make changes to this bug.