LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-16-2003, 07:23 PM   #1
nearfar
LQ Newbie
 
Registered: Oct 2003
Posts: 10

Rep: Reputation: 0
Question .bash_logout does not get executed


Hi,

I am using redhat 7.3. I want to run a script when i logout, to clean up some of the files, processes, etc. I realized that the .bash_logout file does not get executed at logout. Does anyone know how i can make it to execute each time i logout? I tried adding trap in the .bash_profile file (trap "/path/scrip" 0) but that didn't seem to work. I would really appreciate it if someone could help me.
Thank you!
 
Old 10-16-2003, 08:03 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,354
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
I realized that the .bash_logout file does not get executed at logout. Does anyone know how i can make it to execute each time i logout?
Are you sure it *doesn't* get executed and it's not due to a fault in your logout script?
Adding a last line "echo "logout; sleep 2s" to your ~/.bash_logout should show if it really doesn't. ~/.bash_profile will only be executed on login by a login Bash or Sh shell.
 
Old 10-17-2003, 10:35 AM   #3
nearfar
LQ Newbie
 
Registered: Oct 2003
Posts: 10

Original Poster
Rep: Reputation: 0
.bash_logout does not get executed. Also I can run my script manually without problem..any ideas?
 
Old 10-17-2003, 11:40 AM   #4
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
does it get executed when you do not use graphical login? I/e/ go to runlevel 3, and then login from there and see if logging out executes the script. Maybe the logging out inside X doesn't get treated as logging out.
 
  


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
.bash_logout file is not runing on logout Mordeth_0 Linux - Newbie 9 08-19-2004 06:11 PM
commnds placed in .bash_logout not working rddreamz Programming 1 06-05-2004 05:57 PM
.bash_login .bash_logout on KDE and GNOME ja_nch Linux - General 3 10-09-2003 09:09 PM
.xinitrc isn't executed hampel Linux - Software 5 08-06-2003 03:53 AM
.bash_logout act weird!? IamDaniel Slackware 7 06-17-2003 12:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:04 AM.

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