/tmp/kde-$USER/ offenders

Ryan Cumming ryan at kde.org
Thu Dec 12 12:09:20 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On December 12, 2002 03:09, Andras Mantia wrote:
> I have an idea about how to solve the problem, when the app crashes. In the
> majority of the cases the tmp files will remain there. What I think would
> be nice is to keep track of which app (using which pid) opened the
> corresponding tmp files. E.g myApp creates tmp files like "myAppxxxxx.tmp".
> There will be another file which holds the following info:
>
> myApp:pid_no:myApp1234.tmp
> myApp:pid_no:myApp5678.tmp
>
> When myApp starts it can look into this file for entries which starts with
> myApp, and if there is no myApp running with pid_no, then it can remove the
> files.

Another option would be to encode the PID in the filename itself 
(myApp-hexpid-xxxxx.tmp). We could then have a kded module periodically (15 
minutes? 1 hour?) delete the orphaned temporary files. This prevents us from 
further burdening the already slow application startup process, and doesn't 
require a separate database file.

However, the kded module would have to be careful not to delete temporary 
files not created by KTempFile. This could be accomplished by making sure the 
filename is formed correctly, and possibly using a distinguishing file 
extension (.ktemp?).

This idea still seems a bit overkill to me. I'd be content on purging 
/tmp/kde-$USER in startkde; that would be analogous to how most distros clear 
/tmp in their initscripts.

- -Ryan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE9+Hx1LGMzRzbJfbQRAiu5AJ44too7vYeNcLrRltcJrEyXEGUgQgCfdhL/
+zMYfyQdK1rr2GWzkLQ1X4o=
=enUd
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list