Operating System - HP-UX
1832460 Members
3026 Online
110043 Solutions
New Discussion

Re: after-session cleanup

 
Ulrich Deiters
Frequent Advisor

after-session cleanup

How can I define commands that are
carried out whenever a user logs out
(the opposite of .profile)?
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: after-session cleanup

Hi:

You can add a trap to your $HOME/.profile that looks like this:

trap "$HOME/.logout" 0

Then, in $HOME/.logout place whatever commands you wish to have run when you logout.

Regards!

...JRF...
federico_3
Honored Contributor

Re: after-session cleanup

you can use the trap command in your .profile.

trap " complete_path_your_script; echo 'HAVE A NICE DAY'" 0
Ulrich Deiters
Frequent Advisor

Re: after-session cleanup

Sorry, but the "trap ... 0" method does
not work for users running a CDE
session. There must be some other
way; e.g., how is the system told to
empty the trash folder after a user
logs out?
James R. Ferguson
Acclaimed Contributor

Re: after-session cleanup

Hi:

From Knowledge Base document #A5823933A:

Perform the following procedure to execute the 'sessionexit' script each time you perform a system logout:

1. cp /usr/dt/config/Xreset /etc/dt/config/Xreset

2. Edit '/etc/dt/config/Xreset'.

3. Execute your script file within the 'Xreset' file.

...JRF..
Robin Wakefield
Honored Contributor

Re: after-session cleanup

Try creating the file:

~/.dt/sessions/sessionexit

this should run whenever you logout.

Robin