Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using Bash to install a customised version of JBoss, and one of the things I would like to do is install the correct version of the Apache Portable Runtime, which is a native binary.

This script could be run on both 32 and 64 bit versions of RHEL.

What are my options for identifying which version of the APR to install?

I think we only have 32bit and x64-based systems here. I would still like to identify i64 systems so that the script can refuse to install on that type of machine.

I am aware of using uname -m and grepping /proc/cpuinfo to find out, but was wondering which approach others would recommend?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

If you're installing on RHEL systems, you should just use the native package management facilities -- such as yum -- to install APR. This will take care of architecture selection for you, and will make sure that any other dependencies are pulled in.

share|improve this answer
    
Thanks, but I'm not sure that'll work on our heavily-customised JBoss installation. The JBoss we're installing isn't being managed by yum, so I don't know if a yum-installed APR would work? The usual place to put APR is inside a folder on JBoss, though I suppose it could be configured to look elsewhere... –  Rich Jan 6 '11 at 12:49
    
It should work, but if you've already got a process that you're using it's probably easiest to stick with it. If you really want/need to do it yourself, using uname -m as your determining factor is probably fine...you could also explicitly check to see if the 64 bit C library is installed (rpm -q glibc.x86_64). –  larsks Jan 6 '11 at 14:24
    
Thanks for the update - in the end I went for the arch command as that's what a UNIX guy here recommended. I think arch does the same as uname -m, so I'm going to accept your answer :) –  Rich Jan 7 '11 at 9:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.