Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am working with PHYTEC I.MX31 ARM board iam able to observe /etc/profile executed twice after login to system i just want to know where is that function called from.
I am working with PHYTEC I.MX31 ARM board iam able to observe /etc/profile executed twice after login to system i just want to know where is that function called from.
How do you know that?
To answer your question, /etc/profile is an initialization file for bash. Each time that a new interactive login bash session is invoked then /etc/profile is sourced. Then once (and only one, the first found, if any) between ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order is run as well.
Sometimes people symlink those files to each other, or copy them or do other weird stuff (that they shouldn't be doing), resulting in funny effects like the one you describe.
after login u can observe a message displayed "running /etc/profile.local" which is displayed twice and the file /etc/profile.local is called from /etc/profile.
Quote:
Originally Posted by i92guboj
How do you know that?
To answer your question, /etc/profile is an initialization file for bash. Each time that a new interactive login bash session is invoked then /etc/profile is sourced. Then once (and only one, the first found, if any) between ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order is run as well.
Sometimes people symlink those files to each other, or copy them or do other weird stuff (that they shouldn't be doing), resulting in funny effects like the one you describe.
Then you should revise all the files I told you and see if there's anything strange. First of all check if some of them are symlinks to another file. If you don't know how to proceed, you can start by posting the output of this command.
Code:
ls -l /etc/profile /etc/profile.local ~/.bash_profile, ~/.bash_login, and ~/.profile
/etc/profile and /etc/profile.local are just shell scripting files so will it give any result if i give ls -l for these files
Quote:
Originally Posted by i92guboj
Then you should revise all the files I told you and see if there's anything strange. First of all check if some of them are symlinks to another file. If you don't know how to proceed, you can start by posting the output of this command.
Code:
ls -l /etc/profile /etc/profile.local ~/.bash_profile, ~/.bash_login, and ~/.profile
/etc/profile and /etc/profile.local are just shell scripting files so will it give any result if i give ls -l for these files
I want to see if any of these files is symlinked to another one. For example, if ~/.bash_profile is symlinked to /etc/profile then it will produce the effect that you describe.
If that's not it, then we need to look into ALL of these files, and see what's inside.
There are no files inside home directory so the commands are not giving any kind of result.
Quote:
Originally Posted by i92guboj
I want to see if any of these files is symlinked to another one. For example, if ~/.bash_profile is symlinked to /etc/profile then it will produce the effect that you describe.
If that's not it, then we need to look into ALL of these files, and see what's inside.
BY looking into /etc/profile script i identified that /etc/profile.local is called from /etc/profile.
/etc/profile.local has the following lines
export TSLIB_CONFFILE=`/etc/ts.conf`
export TSLIB_PLUGINDIR=`/usr/lib/ts`
export TSLIB_TSDEVICE=`/dev/event0`
Quote:
Originally Posted by i92guboj
It should at least output the lines about /etc/profile and /etc/profile.local, those do exist, don't they? What do these two files contain anyway?
Last edited by sureshlohith; 05-08-2009 at 01:00 AM.
BY looking into /etc/profile script i identified that /etc/profile.local is called from /etc/profile.
/etc/profile.local has the following lines
export TSLIB_CONFFILE=`/etc/ts.conf`
export TSLIB_PLUGINDIR=`/usr/lib/ts`
export TSLIB_TSDEVICE=`/dev/event0`
Quote:
Originally Posted by i92guboj
It should at least output the lines about /etc/profile and /etc/profile.local, those do exist, don't they? What do these two files contain anyway?
after login u can observe a message displayed "running /etc/profile.local" which is displayed twice and the file /etc/profile.local is called from /etc/profile.
Is this message self contained within /etc/profile? Maybe it's some kind of service in the background which launches the first instance of /etc/profile and then your login shell launches the second one.
BUT the message "running /etc/profile.local " is present in the file /etc/profile and i am not able find this in any other file in /etc.
Quote:
Originally Posted by i92guboj
Is this message self contained within /etc/profile? Maybe it's some kind of service in the background which launches the first instance of /etc/profile and then your login shell launches the second one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.