1833883 Members
1773 Online
110063 Solutions
New Discussion

Logging in

 
SOLVED
Go to solution
u856100
Frequent Advisor

Logging in

guys,

should be nice and simple this one.
When a user log into the system, which profile config file is referenced first? I thought that now the system is already up and running, the etc/profile is no longer ran each time a user logs in, but I have been told that this config file is always ran prior to the users .profile file at login (despite the system being up and running).

is this correct?

thanks in advance

john
chicken or egg first?
3 REPLIES 3

Re: Logging in

Yes, /etc/profile is executed first, then $HOME/.profile

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Steven Sim Kok Leong
Honored Contributor
Solution

Re: Logging in

Hi,

The system-wide profile is always executed first before the user's profile during the user's login. This is independent of system startup (i.e. it has nothing to do with system startup scripts).

However, note that the system-wide profile can refer to either /etc/profile or /etc/csh.login. Which system-wide profile is used depends on your login shell referred to in /etc/passwd for your user. The user's profile also depends on the user's login shell.

If your user is using /usr/bin/csh in /etc/passwd as the login shell, then /etc/csh.login is executed but /etc/profile is NOT executed. Subsequently, $HOME/.cshrc followed by $HOME/.login are executed.

Hope this helps. Regards.

Steven Sim Kok Leong
Bill Hassell
Honored Contributor

Re: Logging in

And just to confuse things a bit, if you are logging into a workstation running Xwindows, specifically CDE, local terminal windows will (by default) bypass all global and local profiles. The respective man pages for the various shells talk about the profile sequences and you can read more about profiles in CDE here:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2de59276484dd611abdb0090277a778c,00.html


Bill Hassell, sysadmin