Operating System - HP-UX
1833326 Members
2616 Online
110051 Solutions
New Discussion

Re: setting environment variables

 
Ahmed_41
Super Advisor

setting environment variables

Dear All,

i am not that good so much in HPUX, i am a bit a solaris guy, i was trying to add this line in the .profile file so as when a user login he can start using the pathes i added to him, the problem is , this lines works only when i connect from telnet, while when i connect using reflectionx and open a terminal, these pathes are never there

the lines are

. /opt/OV/bin/ov.envvars.sh (shell script file that sets the variables of $OV_BIN and the others)


PATH=/usr/sbin:$PATH:/sbin:/home/root:$OV_BIN:$OV_CONF:$OV_CONTRIB:$OV_MAN

can someone help me ? my main problem is, why things are working very fine as i wanna when i do telnet, while when i am over reflectionx and opening a terminal these env variables are never there or never set.

thanks in advance
21 REPLIES 21
Sridhar Bhaskarla
Honored Contributor

Re: setting environment variables

Hi Ahmed,

Ensure that you have the following setup correctly.

Uncommented line "DTSOURCEPROFILE=true" in the .dtprofile of the user and a file called '.Xdefaults' with the following lines

dtterm.loginshell: True
xterm.loginshell: True
hpterm.loginshell: True

If you don't have the above, modify the files and restart your reflection X/CDE.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ahmed_41
Super Advisor

Re: setting environment variables

Dear Sridhar,

thanks for the quick reply, but i dont have such file at all on my system called .Xdefaults.

where is that file ?

thanks

Sridhar Bhaskarla
Honored Contributor

Re: setting environment variables

Hi Ahmed,

Create one if you don't have and try.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ahmed_41
Super Advisor

Re: setting environment variables

Dear Sridhar,

i also got another problem this is a separate question

my / partition is 82% utilized and i am so worried about that, can i extend it, and in case i am able to extend it, will i loose my installations and data and everything or what ???

my knowledge in solaris that i can make another / , so is there any way i can extend this / partion or do another one in order to sake my neck from crashing ?

thanks in advance
Sridhar Bhaskarla
Honored Contributor

Re: setting environment variables

Hi Ahmed,

You cannot extend root partition easily as it has to be contiguous. Best way is to take 'make_tape_recovery' tape and reinstall it.

However, / is pretty static except for /etc/lvmconf. Check what is causing your / to grow with the following command

du -kx / |sort -n

Delete any core files that got created. You shouldn't have any directories (not filesystems) owned by other users in / filesystem. If you have, move them to filesystems. Also check your /dev/rmt/0m* and /dev/null files to see if they are no more special files.

With the above precautions, you can keep your / pretty static.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ahmed_41
Super Advisor

Re: setting environment variables

Thanks again Sirdhar,

can you now tell me where to put this file you said about the .Xdefaults ?

i also tried right now to uncomment the .dtprofile file and there was no change, i still login in the CDE and the env variables are not applying to me :(

Sundar_7
Honored Contributor

Re: setting environment variables

Hi Ahmed,

In the past, I have extended root filesystem without re-igniting.

You can do it by adding a spare PV to VG00 and couple of pvmoves.

As Sri has suggested, make sure you dont have any unnecessary files in the filesystem. If you are still convinced that you need to extend root fs, I can walk you through the steps :-)

- Sundar.
Learn What to do ,How to do and more importantly When to do ?
Sridhar Bhaskarla
Honored Contributor

Re: setting environment variables

Hi,

It should be in the home directory of the user that is trying to change his/her profile.

Regarding root extendability, it can be done and even it is bit easier if you have OnlineJFS. All you have to do is to create free space after the root logical volume on the root disk. However, I wouldn't suggest it unless you are very confident with LVM. Regular cleanup of root filesystem can help you avoid getting into the trouble.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ahmed_41
Super Advisor

Re: setting environment variables

ok guys, i did this du command, but unfortunately i couldnt understand the output.

but i attached the output from the du for you here to first, tell me what is wrong with my server, second explain to me the result of the du so as next time i would identify my problem myself ;)

thanks
Sridhar Bhaskarla
Honored Contributor

Re: setting environment variables

Hi Ahmed,

As you can see /etc/opt itself is taking half of the disk space in / filesystem. You can create a seperate filesystem for /etc/opt/OV directory. Since you are intending to use this as a openview server (NNM or VPO), it may not be a bad idea to create filesystems for /opt/OV, /var/opt/OV and /etc/opt/OV and put them in a VG different than vg00.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: setting environment variables

I forgot about the details of 'du -kx' output. 'du -kx ' gives the output in KB of every directory that is not a mount point within the specified . In your case, it is going to display all the directories with their sizes in KB under "/" filesystem. You are sorting them to get a better view.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ahmed_41
Super Advisor

Re: setting environment variables

Dear Sirdhar,

can i have some explaination here please guys, i am supposed to have my OV direcoty under /opt, so i have never had such path called /etc/opt/OV
i always got this /opt/OV
so i dont understand how this path came from this /etc/opt/ov

second which is very important, when i do a bdf, i get the the /opt is using 22% only, and others like /stand, /var and others all of them never exceeded the 23% except for the / which is 85% , so what is the relation between the /etc and my /opt i am using ???


second Sirdar, i did the 2 files u told me and i am still unable to use my env variables :(
Sridhar Bhaskarla
Honored Contributor

Re: setting environment variables

Hi Ahmed,

OV gets installed under three directories with the following setup.

/opt/OV - Binaries and documentation
/etc/opt/OV - Configuration
/var/opt/OV - working area

Did you restart your CDE/Reflection X?.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ahmed_41
Super Advisor

Re: setting environment variables

you mean the reflectionx client? or you mean the xserver itself on the UX machine ?

second which is very important, if i took the descion to move the /etc/opt/ov to another vol, wont that affect my installation ??

currenly i installed and configuerd lots of things on NNM and things are running quite good, so doing this move for the /etc/opt/ov wont affect my installation ???
or i will have to rebuild my work from scratch or what ??

thanks
Sridhar Bhaskarla
Honored Contributor

Re: setting environment variables

Hi Ahmed,

Logoff and login again on Reflection X.

Regarding /etc/opt/OV, you don't need to reinstall anything. In fact, prior to the installation of NNM, you could have configured these three directories as filesystems so the software would directly go in there. Follow these steps create a mount point. Find out a VG say vg01 that has enough space to hold Openview. If you don't have external filesystem, atleast have it from vg00.

1. Stop NNM. Make sure you don't have any openview processes running on the system.
2. Create LVs and filesystems.

lvcreate -n etcoptov -L 500 vg01
newfs -F vxfs /dev/vg01/retcoptov

3. mv /etc/opt/OV /etc/opt/OV.old
4. mkdir /etc/opt/OV
5. Edit /etc/fstab, copy an existing entry and change the LV and mount point to etcoptov and /etc/opt/OV. Run 'mount -a'. Make sure /etc/opt/OV is mounted now.
6. Copy the data

cp -Rp /etc/opt/OV.old/* /etc/opt/OV

Since /opt and /var are seperate filesystems, you may not need differnet filesystems for /opt/OV and /var/opt/OV.

7. Start NNM and verify. Let it run for couple of days and remove /etc/opt/OV.old directory.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ahmed_41
Super Advisor

Re: setting environment variables

Sridar,

thanks again, but is there any risk in doing such solution ?? i really spent lots of time here to get my installation and configuration up and running in a good way.
so is there any risk that this solution would end up with my installation or conifguration going wrong ?
second, up to my understanding /etc/opt/OV is something like a pointer to the exact location on the media (hardisk), so changing the mount point from one disk to the other while keeping the same pointer to be /etc/opt/OV wont affect my installaiton, correct me if i am wrong please.

thanks
Sridhar Bhaskarla
Honored Contributor

Re: setting environment variables

Hi,

Only risk is if you fat finger anything during the copy process. So, I suggested to keep /etc/opt/OV.old for sometime so that in case of any issues, you can always unmount and move OV.old back as OV.

If you are careful, there is no risk.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ahmed_41
Super Advisor

Re: setting environment variables

by the way also
i restarted the deamons, and i logged off reflectionx and back again and still nothing changed, i cannt get my env variables loaded
Ahmed_41
Super Advisor

Re: setting environment variables

Sri, Sundar,

how about Sundar solution of having another spare PV for the vg00 ??? is it much more safer, and will it be more efficeint on the long run with the openview running and genetrating data ?? and what are its risks, i am really afraid of trying any risky action here, i managed to get a stable installation and i am afraid to loose this factor of stability, so lets discuss the othe solution of having a spare PV for the vg00 how to be done, what risks, what benifits, how on the long run will it do ?

second can someone tell me how to do this in steps ?

thanks in advance
Sridhar Bhaskarla
Honored Contributor

Re: setting environment variables

OK - This is my last response before I call it a day here.

1. As long as you have .dtprofile and .Xdefaults file in the home directory with the syntax I mentioned, your .profile should get executed. For ex., if you are getting into RefX as user1, then have those files in the home directory of user1.

2. Extending the root logical volume is much riskier than create a seperate filesystem for /etc/opt/OV directory, particularly if you don't have OnlineJFS. There is absolutely no risk involved in making /etc/opt/OV as a filesystem. What you are doing is moving the files from root filesystem onto a different filesystem. On the long run, it's much safer if you need to add more OV softwares.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ahmed_41
Super Advisor

Re: setting environment variables

guys, i have been tracing everything here till i was able to get this file, i think this will be my last post now cuz i think i am about to catch this error
please have a look to this file