Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

JBoss scanning should use -xdev when running the find command #289

Closed
chambridge opened this issue Sep 8, 2017 · 4 comments
Closed

JBoss scanning should use -xdev when running the find command #289

chambridge opened this issue Sep 8, 2017 · 4 comments
Assignees
Milestone

Comments

@chambridge
Copy link

chambridge commented Sep 8, 2017

Specify type:

  • Enhancement

Description:

When the Jboss scanner tasks that use a 'find' command run on large filesystems the commands take a long time to complete (sometimes days) causing the script to appear hung.

Related to #273


Bug Report

Version of rho:

ALL

Environment information:

Target filesytem was NFS and below is the size and path.

ipxnas03.midwestiso.org:/sysdeploy
6.9T 5.2T 1.8T 75% /sysdeploy


I have tested scanning an NFS filesystem with EAP 7.0 in the share mounted on /jboss and when the -xdev option is used that directory is not scanned.

Below if the commands I used.

FOUND=""; for jar in `find / -xdev -name 'jboss-modules.jar' 2>/dev/null | grep -v '\.installation/patches'`; do VERSION=$(java -jar ${jar} -version 2> /dev/null | grep version | sed 's/.*version\s//g'); inode=$(stat -c '%i' "${jar}"); fs=$(df  -T "${jar}" | grep "/dev" | sed 's/ .*//'); ctime=$(stat ${jar} | grep 'Change' | grep -oP '[1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]'); if [ ! -z "${VERSION}" ]; then if [ ! -z "$FOUND" ]; then FOUND="$FOUND; $VERSION**$ctime"; else FOUND=${VERSION}'**'${ctime}; fi; fi; done; echo ${FOUND}

FOUND=""; for jar in `find / -xdev -name 'run.jar' 2>/dev/null`; do VERSION=$(java -jar ${jar} --version 2> /dev/null | grep build  | sed 's/.*[CS]V[NS]Tag.//g' | sed 's/\sdate.*//g'); inode=$(stat -c '%i' "${jar}"); fs=$(df  -T "${jar}" | tail -1 | sed 's/ .*//'); ctime=$(stat ${jar} | grep 'Change' | grep -oP '[1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]'); if [ ! -z "${VERSION}" ]; then if [ ! -z "$FOUND" ]; then FOUND="$FOUND; $VERSION**${ctime}"; else FOUND=${VERSION}'**'${ctime}; fi; fi; done; echo ${FOUND};
@chambridge
Copy link
Author

@mdvickst

Seems like this is a simple update to just add the -xdev flag to tasks where we are performing the find command, or am I missing something else here?

@chambridge chambridge added this to On Deck in RHO 2.0 Sep 8, 2017
@mdvickst
Copy link

mdvickst commented Sep 8, 2017

Yes, I added this to the JBoss scanner last week but today I had feedback that a customer is running JBoss in /opt which is a separate filesystem for them.

I think we should still use -xdev but may include some of the common directories in the find command in case they are on separate filesystems.

E.g.

FOUND=""; for jar in `find / /opt /app -xdev -name 'jboss-modules.jar' 2>/dev/null | grep -v '\.installation/patches'`; do VERSION=$(java -jar ${jar} -version 2> /dev/null | grep version | sed 's/.*version\s//g'); inode=$(stat -c '%i' "${jar}"); fs=$(df  -T "${jar}" | grep "/dev" | sed 's/ .*//'); ctime=$(stat ${jar} | grep 'Change' | grep -oP '[1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]'); if [ ! -z "${VERSION}" ]; then if [ ! -z "$FOUND" ]; then FOUND="$FOUND; $VERSION**$ctime"; else FOUND=${VERSION}'**'${ctime}; fi; fi; done; echo ${FOUND}

@chambridge
Copy link
Author

@mdvickst Ok. To sum up we can add the -xdev option to the find commands, but when we do we should expand our default for the --scan-dirs option to be ['/', '/opt', '/app'].
Sound good?

@mdvickst
Copy link

mdvickst commented Sep 8, 2017 via email

@chambridge chambridge self-assigned this Sep 8, 2017
@chambridge chambridge added this to the Sprint 6 milestone Sep 8, 2017
@chambridge chambridge moved this from On Deck to In Progress in RHO 2.0 Sep 8, 2017
chambridge added a commit that referenced this issue Sep 8, 2017
Add -xdev option to find commands but expand default scan directories. Closes #289.
@chambridge chambridge moved this from In Progress to Done in RHO 2.0 Sep 8, 2017
@chambridge chambridge removed this from Done in RHO 2.0 Sep 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants