![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What happens when user logout? | yhacks | Linux | 1 | 05-15-2008 11:20 PM |
| Executing script with root privilages from a user login | checkpro | SCO | 1 | 03-11-2008 02:03 PM |
| Shell script to find when user su'ed to root | jrvilino | Shell Programming and Scripting | 1 | 03-05-2008 06:31 AM |
| root executes a script as another user | tads98 | Shell Programming and Scripting | 1 | 05-17-2005 05:54 AM |
| Canīt logout to user inactive | lalox | UNIX for Dummies Questions & Answers | 1 | 07-31-2004 06:31 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
run a script on logout by a non-root user
hi ,
i need to run a script that delete files when i logout as a user other than root user . I have tried out using .bash_logout but that doesnt seem to work , so any alternative for this to be done. Thanks in advance, Harsha |
| Forum Sponsor | ||
|
|
|
|||
|
Thats true , but what i need is ,
to write the 'trap rm' command (as mentioned in your reply ), in the file which is accessible by a normal user . I need to insert this command through my program as a normal user. (/etc/profile can be changed only by the root!!) Is there any way out for this prob? |
|
|||
|
If you want to set a trap for a single user, you can add it to the user's $HOME/.profile
Perhaps you could explain a bit more about the problem you are trying to solve. If you are using bash and the .bash_logout is not being executed, that is of course also something to look into. |
|
|||
|
Need to make a script run from my program which deletes certain files as and when the user logouts from the GNOME log screen.
This program is run by a normal user (not the root user). If I write the required commands in $HOME/.profile , the files get deleted when ever the user logs in again , but i need to delete the files immediately after the user logs out. i believe .bash_logout doesnt not work if we use GNOME log screen for logging off. |
|
|||
|
You cannot really hook into the shell's login/logout scripts, as those are not invoked the way you would expect in Gnome. In particular, the user might login over the network, and/or run multiple terminals in the Gnome session, each of which is a separate shell session.
Instead, look into how GDM handles X sessions (or your login manager, if it't not GDM). |
|||
| Google UNIX.COM |