I'm trying to run a script when user logged out. My linux distribution is Pardus that uses KDE. How can I do this?
I've heard about "/.bash_logout" but I couldn't implement that. Where should I create the "/.bash_logout" file?
I am assuming that you want this on a per-user basis for the following
There are a few different options, but first to clear up a misunderstanding, you mention "/.bash_logout", but everywhere I have seen suggests
The ~ is a short way to say "this user's home". So that would mean you need to make the
Another option is to use KDE's suggestion of:
If you want this to happen for all users
Note: I do not have KDE to test the KDE specifics for you.
First of all, you can create a file in your home directory called
First check if your system supports this file. (e.g. it might not do anything if you do not run bash. You might be using an other shell, such as zsh, sh, pinosh, dc, ...
Testing this can be as simple as doing a
Next read up on nohup. Basically when you log out from a shell each program which is still running will get a signal telling it to stop. This signal is called
You can either write a program and allow it it intercept the sighup, in which case you can choose to do noting. Or use the
During all that time my terminal is busy, hopefully showing the successful compilation of a new kernel. I can not do anything else.
Now if I add an ampersand (