Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
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. |
|
 |
03-31-2004, 06:01 PM
|
#1
|
|
Member
Registered: Feb 2004
Posts: 40
Rep:
|
Login shells vs non-login shells
What is the difference between a 'Login shell' and a 'Non-login shell'?
From what I can gather, login shells source the /etc/profile and the ~/.bash_profile files as well as the /etc/bashrc and ~/.bashrc files. Non-login shells only source the latter two...
So what is the difference, and why is one used over another?
If I am in runlevel 3 each of the virtual terminals is a login terminal... right?
If I start a terminal in X, is it a login shell or a non-login shell? Why?
I have Eterm, and you can choose whether to make it login or not. Why should I have it either way?
Thanks in advance....
|
|
|
|
03-31-2004, 07:02 PM
|
#2
|
|
Member
Registered: Nov 2003
Distribution: RedHat 9.0
Posts: 45
Rep:
|
Some people have things in their ~/.bash_profile that you wouldn't want running in an Xterm. For example, I have made a .bash_profile that automatically started X when the user logged in.
Basically, the .bash_profile is used for things that only have to be done once per login, especially system administrative per-user tasks.
However, I'm not sure what the non-login and login distinction was originally for, and I'd be interested to know.
|
|
|
|
03-31-2004, 07:29 PM
|
#3
|
|
Member
Registered: Dec 2003
Location: Toronto, Canada
Distribution: Mandriva, Ubuntu, LFS, gNewSense
Posts: 221
Rep:
|
Hstorically, all logins started with the invocation of a shell, and all further commands would be executed from that shell, and inherit its environment. If you use startx from a login shell, this is still the case.
Over the course of a session, many shells will be started, and there is no need to re-initialize the environment for each one.
Nowadays, many people bypass the shell and log in directly to X via a display manager (xdm, gdm, kdm, or similar). Chances are that your .bash_profile (or .profile) will not have been sourced during the initialization of X, so you may wnat to start bash as a login shell to set up your preferred environment.
|
|
|
1 members found this post helpful.
|
| 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 05:49 AM.
|
|
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
|
|