weird stuff in /tmp

Dr-Host

Verified User
Joined
Mar 23, 2004
Messages
107
Location
Israel
Hi guys,

Listen in the past week or two my /tmp folder is filled with

sess_459359d7ba63f9968aaf1f466948b166 sess_a05a2e8bda02b3f8a9e133e4962a9afe sess_f80a3fe747a632e530ff942b54ca9b92
sess_459d7287fdfc7d43264c0b4011c2ec20 sess_a12255147204e89051ac3dade38eee42 sess_f861e39f4f41d0d4476d0463ae95d206
sess_45aacb06e7e4edd53da8e343516bf6b0 sess_a12ab4b8d04404e17b24df988d3dd38f sess_f86ece0e578e20528bf89450c6e22dec
sess_45e4045b6e3fce495023d8fa162150e8 sess_a19220883e402520c397485ed44cfaa9 sess_f8dde043e5718d61841460e9363f5997
sess_4608df236bfa6b4a79826ed2afee2a7c sess_a1f029361df1507e166fae47d77eb7d3 sess_f9093b439b347e5759ba5fb7cf1bdaa2
sess_4645a5e4857902c11d74a00c5f3c9315 sess_a213a9df2d521da87f408db499af7099 sess_f9bdce5b6c7e9d5638ab1e0d39532328
sess_46579a00fe96ca019e41f91eb03c01d8 sess_a299b5275eff723873306d8ae9ae2f57 sess_f9e55ab8b3cb36a73ae8ead031ef0a54
sess_467d528a5a260b1ebaddd9f476109999 sess_a309a20434cbe53fc08768afab9d9924 sess_fa01dcd40e748c039dda83415a84957d
sess_46c397d6803040aff00a42afd11b7740 sess_a32544c50b84e327dde77c13ce9de68d sess_fa03d9c889ac1fc54469c01bdc505c4a

ext, files all files contains something like this in it:

tstart|d:1154266356.690495967864990234375;

and as far as I can see its just sessions files but the problem is that they don't delete them selvs so is there something I can do to make them del them selvs or to find the website that has this sessions issues?

Thanks,
David
 
xemaps said:
make a cronjob
sample command

rm -rf /tmp/* >/dev/null 2>&

choose time aso

I know you said sample command, but I don't think that is the best example, since someone will actually try that. The reason I wouldn't do this, is that some programs create UNIX sockets in /tmp and doing this will remove them, and cause you a few problems. I would make it more like:
rm -f sess_*
or even something similar to
find /tmp/ -name sess_* -atime + -exec rm -f {} \;
to remove session files not accessed in the past 5 days.
 
on my server i changed the tmp var for php in /home/user/ so there are only php sessions in the temp php folder ;-)

Why i did that ? just to have access with main ftp account to the temp folder

Sure this can be done with different ways.
 
take a look at your tmpwatch cron,
maybe it's set to only delete files not used longer then 24 hours set it to 4 hour for example
 
The problem is not to delete them is how the got there if i'll chmod 755 /tmp nothing most sites work after setting chmod 777 /tmp within 5 sec over 15 sessions I wanna know where its coming from because I know that the website doesn't use sessions_destroy() for session_expire()
 
You could do something like:
Code:
cd /home
find . -name *.php -exec grep session_register\(.tstart /dev/null {} \;

That should find any php script that creates a session variable called tstart. You may need to tweak the code a little, incase they put spaces around the parens.
 
Back
Top