LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-17-2003, 07:07 PM   #1
mellsie25
LQ Newbie
 
Registered: Oct 2003
Location: In front of my computer at Pindi Pindi
Distribution: RHL9.0 and WinXP
Posts: 12

Rep: Reputation: 0
Question What happens when Linux logsout from command line?


Hi I was wondering if someone can explain to me what steps linux goes through when you logout or exit the command line (init 3). I know the login process works as I've put echo statements within the relevant files. Logout works to a point:

~/.bash_logout clears my screen when I exit, and shows the echo statement I put in there. Then it hangs.

I was wondering what happens after you type exit and hit enter. What files does linux call before displaying the login prompt screen? Could file permissions have been altered? If that could be the reason for hanging - that is why I need to know what files are accessed?

I'm still learning all this linux stuff (using RHL9.0) - probably never stop learning.

Any replies would be greatly appreciated.

Thanks
 
Old 10-17-2003, 07:14 PM   #2
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
I believe it's hanging because you have a command that has output in your logout file. You should not have a echo statement in this file.

As for what linux does it executes this file as you know and kills any processes running in the forground on that terminal.

You could try this one:
export HISTSIZE=0
this will clear your history on logout, I dunno if this is what you want to do I use my history most times.
 
Old 10-17-2003, 07:21 PM   #3
mellsie25
LQ Newbie
 
Registered: Oct 2003
Location: In front of my computer at Pindi Pindi
Distribution: RHL9.0 and WinXP
Posts: 12

Original Poster
Rep: Reputation: 0
No I don't want to clear my history - I use it too. Question: if there are background processes - does it kill those too. Could it be that there are background processes running?

Also, it hung prior to me putting in the echo statement - I put that echo statement in there to see if logout was actually being called properly.

This is for a uni assignment that I have submitted already - we had to download 'system emergencies' which did something to our linux system, then we had to find what was wrong and fix it. I have found what was wrong - but had no idea how to fix it, so I submitted my assignment explaining that.

Now I am interested in finding out what they could have done to my system to cause it to hang. My first emegency was simply an incorrect slash used in the boot process command: \ instead of /. So my first emergency was fine - but this second one had me stumped.

Like I said - I can see that it is hanging once I type exit or logout from within the command line, but don't know what is wrong with the system once I hit enter - hence me wanting to know what files it calls, what actually happens once I hit enter. I take it the bash_logout file is called which clears the screen - but then what happens prior to displaying the login prompt? Could altered file permissions have caused this?

Thanks for your prompt reply.
 
Old 10-17-2003, 07:27 PM   #4
mellsie25
LQ Newbie
 
Registered: Oct 2003
Location: In front of my computer at Pindi Pindi
Distribution: RHL9.0 and WinXP
Posts: 12

Original Poster
Rep: Reputation: 0
My ideas was that it could be something as simple as a 'space' being inserted in a file, where it shouldn't have one. It could be that something has been commented out by #. Or that file permissions have been altered for some file. But I don't know what files it uses once the ~/.bash_logout clears the screen.

They also supplied us with an emergency fix - that fixes the system. So my system is now back to how it should be, but I would like to execute the emergency again and actually learn how to solve it, and find out what they did to cause it to hang?
 
Old 10-17-2003, 07:33 PM   #5
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
OK, I've lost you.

" it hung prior to me putting in the echo statement"

Are you saying if you take every change out of you logout file you still have these issues? If so I think the issues are not bash_logout related. Can you post your logout file?

asignment? I'm not doing your homework am i?
 
Old 10-17-2003, 07:43 PM   #6
mellsie25
LQ Newbie
 
Registered: Oct 2003
Location: In front of my computer at Pindi Pindi
Distribution: RHL9.0 and WinXP
Posts: 12

Original Poster
Rep: Reputation: 0
No - like I said I have already submitted my assignment - you will just have to have faith in me that I'm telling the truth. It was due yesterday so I submitted it saying that I knew what the emergency had caused my system to do, but didn't know how to fix it. I'm just very curious to find out what they did. I'm finding Linux very interesting and will continue using it and stuyding it once uni has finished. My bash_logout file, prior to me putting in the echo statement was just:

# ~/.bash_logout

clear


From this I took it that this file just cleared my screen. Something else then takes over to bring up the login prompt screen. What happens after this file clears the screen?

NB: Even if my assignment was still due, we were allowed to search the internet to find out if other people had experienced similar problems, and I took it that if I did have a systems admin position, and couldn't fix a problem, that I could post to a forum to see if anyone else had any ideas. There are numerous ways to find a solution to a problem, I am just using one of those ways: a forum.

But trust me - I have already submitted my assignment anyway - okay :-) I don't like the fact that some uni students have others do their assignments (e.g. someone I spoke to had a mate of his do his programming assignments, and this guy did his mate's hardware related assignments). I don't think that's fair, because you are not showing what you know - and I have stressed myself out and put myself under lots of pressure, because I want to learn - not have someone else do it for me. I study externally, so I don't even have other internal students to talk to - I have done it all on my own and have only a computing project to do and one other subject and I will have a degree. All my own work - and proud of it.

Thanks again, for your prompt reply - it is much appreciated.
 
Old 10-17-2003, 08:03 PM   #7
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
"What happens after this file clears the screen?"

Nothing, your terminal is terminated.

BTW' I'm not accusing you of cheating. I was just curious'

snip from man:
~/.bash_logout
The individual login shell cleanup file, executed when a login shell exits

and:

When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists.
 
Old 10-17-2003, 08:16 PM   #8
mellsie25
LQ Newbie
 
Registered: Oct 2003
Location: In front of my computer at Pindi Pindi
Distribution: RHL9.0 and WinXP
Posts: 12

Original Poster
Rep: Reputation: 0
so - I take it there is something happening when it is trying to read the files that then make the login screen reappear?

If there is a background process running - does logout shut it down too?

Do you have any other idea about what might be causing it to hang?

I've read numerous man pages, and I just can't seem to come up with what would be causing it to hang. I know I came across the file that contains the message that displays after boot process and waiting for you to login:

RedHat Linux 9.0
blah blah

login:

(can't think now what file it was).

If the login prompt displays when you first boot into the system - I take it this should mean that there is nothing wrong with the scripts that make that appear, all permissions would be correct, so when I exit there should be no reason why they don't appear again - Correct?.

And if the bash_logout file is clearing this screen just like it should - obviously no problem there either - Correct?.

See why I am at a total loss? I'm sure it is something so simple, that I am overlooking. It can't be too big a problem, because we are expected to be able to load our emergency disk and fix the problem from within our safe state. Just wish I knew what the problem was <Grin>
 
Old 10-17-2003, 08:26 PM   #9
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
I'm sorry I can't help you anymore. I just don't know what your doing anymore'
 
Old 10-17-2003, 09:21 PM   #10
mellsie25
LQ Newbie
 
Registered: Oct 2003
Location: In front of my computer at Pindi Pindi
Distribution: RHL9.0 and WinXP
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks - no prob. Will just have to wait until I get my assignment back to see if the results are released and then I can finally have my curiosity satisfied (if they actually tell us what they did).

Thanks again......
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to use command line with Linux ywergs Fedora 7 10-01-2005 09:56 PM
Linux Command Line Basics civicsi Linux - Newbie 6 04-24-2004 04:14 PM
Command Line On Linux??? unwrittenlaw Linux - Newbie 7 11-25-2003 12:59 AM
Simple help in Linux command line daeojkim Programming 3 09-30-2003 10:21 PM
Command Line Linux Fusion07 Linux - Newbie 6 07-03-2002 12:47 AM


All times are GMT -5. The time now is 04:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration