Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 09-06-2005, 08:48 AM   #1
Registered: Sep 2005
Location: California
Distribution: Slackware & Debian
Posts: 264

Rep: Reputation: 30
logoff scripts

How can i write a script which runs every time a user logs off?

How would i do this that it runs for every user and how would i do this for only one user?

I am using slackware 10. The shell should be bash (i am not sure. it shows user@computer:~$ at the command prompt)
Old 09-06-2005, 12:36 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
From "man bash":
The individual login shell cleanup file, executed when a login shell exits
You'll need to be careful depending on what you are trying to achieve to make sure that dropped connections etc are dealt with properly.
Old 09-06-2005, 03:24 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
In addition to what David said:

As for the "for all users" - there's no generic way, you
can give them all an (identical?) ~/.bash_logoff ...

If you tell us WHAT kind of clean-up work you envisage
we can probably come up with more ideas.



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
Force logoff Harlin Linux - General 2 07-24-2005 09:35 PM
Problem regarding logoff anoopkv1 Linux - Software 1 03-30-2005 11:56 AM
Where is the logoff button? pe2338 LQ Suggestions & Feedback 2 08-08-2003 01:06 AM
Logoff problem Shad-Darim Linux - Newbie 5 07-21-2003 03:07 PM
X Windows LOGOFF anima_a_ignifer Linux - Software 0 11-06-2002 07:23 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:14 PM.

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