LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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



Reply
 
Search this Thread
Old 03-19-2005, 12:47 PM   #1
withjigs
LQ Newbie
 
Registered: Mar 2005
Location: india
Distribution: fc1/fc3
Posts: 6

Rep: Reputation: 0
how to add logout scripts ??


hello friends..
i am using fc1 and fc3 distrozzz....
wanted to add a login script and a logout script for all users in our NIS network...
i have added login script in ".bash_profile" file of all users....
but what about logout script ??
".bash_logout" is not working out...
 
Old 03-19-2005, 01:39 PM   #2
cylix
Member
 
Registered: Dec 2004
Location: Ohio
Distribution: Fedora Core 3
Posts: 125

Rep: Reputation: 15
I verified .bash_logout is working on FC3 (was curious to see if it was a bug)

Since you have created these files for those users, do make sure the appropriate permissions are applied. Obviously, read access is necessary, but it appears execute is not as this script is a function of bash.

Here is a default one from /etc/skel

# ~/.bash_logout

# invalidate the gpm selection buffer iff logging out from a
# virtual terminal
if test -x /sbin/consoletype && /sbin/consoletype fg
then if test -r /var/run/gpm.pid && test -d "/proc/$(/bin/cat /var/run/gpm.pid)"
then kill -USR2 "$(/bin/cat /var/run/gpm.pid)"
fi
fi

clear

Though my root one only contains the header and clear. I don't know what would happen if you used #!/bin/bash as the header, but it may not be a good idea. (Though I haven't tested to see what happens... I suspect nothing)

I want a video of Balmer running around screaming, "Permissions, permissions, permission."
 
Old 03-20-2005, 12:54 AM   #3
withjigs
LQ Newbie
 
Registered: Mar 2005
Location: india
Distribution: fc1/fc3
Posts: 6

Original Poster
Rep: Reputation: 0
it works when you are using...but dosen't seem to work when you are using xwindow....

i have just added following line for testing

"touch xyz" in .bash_logout

but no file is created when user logs out....

i have already checked permissions...
 
Old 03-20-2005, 09:52 AM   #4
cylix
Member
 
Registered: Dec 2004
Location: Ohio
Distribution: Fedora Core 3
Posts: 125

Rep: Reputation: 15
By doing a touch .xyz without specifying anything, it might be using the CWD env variable (Current working directory) Though if you were in the home directory at the time it shouldn't be an issue.

An Xterm, from X fires off a interactive non-login shell.

No logout scripts will be called in this manner (from bash anyway), typically it only copies the current environment variables and executes .bashrc

To execute xterm as a login shell, use -ls

Other terminals you will have to consult the documentation.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VPN: Debian Scripts -> Mandriva 2006 Scripts Undefined Mandriva 0 11-30-2005 01:10 PM
How to add default gateway in /etc/sysconfig/network-scripts/* zamri Linux - Networking 2 09-06-2005 11:32 AM
How To Add Scripts and Options At Startup? thugic Slackware 1 01-05-2005 09:17 PM
Want to run a few scripts before KDE shutdown, where can I add them. Brian1 Linux - Software 6 06-16-2004 07:36 PM
Where to run scripts automatically on login/logout hilltop*Tech Linux - General 2 02-06-2004 11:59 AM


All times are GMT -5. The time now is 06:35 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration