LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   where to write my logout script? (https://www.linuxquestions.org/questions/linux-newbie-8/where-to-write-my-logout-script-692186/)

minge.zu 12-22-2008 04:32 AM

where to write my logout script?
 
Hi,everyone,I have a problem about system log out.
My program is running when the system log out.The system will kill the process of my program.What I want to do is to do some clean operations before the process is killed.How can I achieve this?Is there scripts where I can write my clean operations?
Any advise is appreciated.

colucix 12-22-2008 04:47 AM

You can try to put your commands in $HOME/.bash_logout.

chrism01 12-22-2008 07:53 PM

Do you mean it dies

1. when you logout
OR
2. when the system shuts down

For 1.
disconnect the prog from the terminal session

nohup your_prog &

2.
Add an interrupt handler to your program


All times are GMT -5. The time now is 08:13 AM.