| Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-31-2013, 06:59 PM
|
#1
|
|
Member
Registered: Jul 2012
Posts: 147
Rep: 
|
Hidden environment variables??
Hi all,
I am trying to port a custom application from a RHEL4 server to a RHEL6 server.
On the RHEL 4 server, if you run the command: "env". The person who set this up had custom environment variables set so the application could use them in the scripts.
I grabbed the environment variables. exported from the /etc/bashrc ran source and restarted the server and they now appear on the RHEL6 server.
Situation is the custom application I run, does not recognise these environment variables and I cannot locate them ANYWHERE on the RHEL4 box.
I have searched for hidden files, .bashrc, .bash_profile , /etc/bashrc, /etc/rc.local, files in /etc/skel for any export statements which define these variables on the RHEL4 system and cannot locate any.
My only thoughts are they are some how in the custom application code, and generated to the bash shell ?
anyone have any ideas? I am kinda stumped.
Thanks for your time...
|
|
|
|
01-31-2013, 11:01 PM
|
#2
|
|
LQ Newbie
Registered: Mar 2009
Posts: 15
Rep:
|
Another place to check for custom variables is the application's startup script.
Also are you running this process as a daemon with its own application user, or manually?
Some more info would be good.
|
|
|
|
01-31-2013, 11:22 PM
|
#3
|
|
Member
Registered: Jul 2012
Posts: 147
Original Poster
Rep: 
|
Sorry for the lack of info:
Ok it's a custom app they run called menu or bms.
lsof /applic/bms/obj/menu
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
menu 8798 npilavid txt REG 8,2 364444 1613601 /applic/bms/obj/menu
menu 12972 npilavid txt REG 8,2 364444 1613601 /applic/bms/obj/menu
ls -l /applic/bms/obj/menu
-rwxr-xr-x 1 phil bms 364444 Sep 29 17:13 /applic/bms/obj/menu : looks to run as user phil and everyone has to be in the group bms to run it.
file /applic/bms/obj/menu
/applic/bms/obj/menu: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
It loads up in there .bash_profile. There is no startup script or daemon for it.
# additional procedures for BMS users
#
if [ `id -gn` = "bms" ]
then
umask 0000
cd /applic/bms
case `id -un` in
phil)
return 0
;;
*)
exec menu
;;
esac
fi
looks like the env variables must be set by this binary....
Thanks...
|
|
|
|
02-01-2013, 01:40 AM
|
#4
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,021
|
The binary probably sets its own env for security. If it can't use them, it probably means the values are set in a cfg file somewhere. For super security, the cfg file could be encrypted with the key in the prog code.
Basically, save yourself some time and either ask the guy who wrote it or check the src.
You should have the src if it was written in-house.
If it wasn't written in-house, ask the company who supplied it.
|
|
|
|
02-02-2013, 02:11 AM
|
#5
|
|
ELF Statifier author
Registered: Oct 2007
Posts: 648
Rep: 
|
If you run on your old server command
Code:
tr '\0' '\n' < /proc/<PID>/environ
you'll get all and any environment variables used by your program.
doesn't matter where them were set
|
|
|
|
02-03-2013, 03:29 PM
|
#6
|
|
Member
Registered: Jul 2012
Posts: 147
Original Poster
Rep: 
|
Code:
pidof menu
24149 24117 23696 23664 23039 21803 21771
tr '\0' '\n' < /proc/21771/environ
: gave me the same environment variables as the bash shell.
It's ok I will contact the company who supplied it.
Thanks everyone for your help.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:05 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|