Operating System - HP-UX
1753779 Members
7307 Online
108799 Solutions
New Discussion юеВ

How could .profile be changed?

 
SOLVED
Go to solution
Deepu Chakravarty
Regular Advisor

How could .profile be changed?

I have one login user like 'abc' which have .profile. I have put specific env for the user. But somehow its gets changed after sometime and original settings coming into effect, overriding the changes I have made.

I am not able to figure out how the .profile is getting changed.

Help is required to resolve the problem. "The changes I have made in .profile should be permanent and should not get changed."
9 REPLIES 9
Arunvijai_4
Honored Contributor

Re: How could .profile be changed?

Hello,

The specific env in .profile is not in /etc/profile ? Make sure, it is not.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Peter Godron
Honored Contributor

Re: How could .profile be changed?

Hi,
which shell is the user login into? The .profile file is not the only one used.
You could also switch debug on to trace what is happening.
Muthukumar_5
Honored Contributor

Re: How could .profile be changed?

Are you saying that .profile setting is not available in the same shell?

We can change / modify the default environment variable in the shell. When ever you try to use subshell then it will have only default settings not the .profile changed settings. If you are going to use sub shell then try as,

. $HOME/.profile

it is enough. You can use .profile changed env variables.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: How could .profile be changed?

Hello,

Check the shell which user logged in and did the shell got changed afterwards ?

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Robert-Jan Goossens_1
Honored Contributor

Re: How could .profile be changed?

Deepu,

Are the env settings changed after you login or is the user changing the file?

If the user is changing the .profile, you could change the ownership and the permissions of the file.

# cd /home/abc
# chown root:sys .profile
# chmod 444 .profile

Robert-Jan
Deepu Chakravarty
Regular Advisor

Re: How could .profile be changed?

Thanks for the replies.

1.User is not changing the settings as the .profile has root permissions.
2.After I change the required settings and login in the changed settings, it shows the changed env for sometime. But the next day I login to the same user, the .profile came into the old .profile settings and date stamp is 15-Jun-2005 (when actually this user was first created).
Peter Godron
Honored Contributor
Solution

Re: How could .profile be changed?

Hi,
is it possible you have a cron job scheduled to copy an original .profile? If the copy happens it would not change the datestamp.
Deepu Chakravarty
Regular Advisor

Re: How could .profile be changed?

Dear Gordon,
You are right. One old cron job was still running and it was to restore backups for cloning purposes. Since the restored data was full backup of the applications, it was also included the $HOME of the applications user. "The job was to run in the morning 10 a.m. which was earlier used to restore backups in test env." But somehow it was forgotten to switch off the job after the required restoration. So the cron job is running every morning at 10 a.m. and again and again copying all files including the .profile.
Now I have disabled the cron job.
Thanks for the good info.
Deepu Chakravarty
Regular Advisor

Re: How could .profile be changed?

Thanks. The solution is provided.