Cleaning up sessions issue
Since cPanel started placing sessions in /var/cpanel/php/*, these have not been automatically cleaned up, at all. This should be either added to tmpwatch, or cleaned up manually, because these drastically affect clients who have inode limits.
I've seen servers go from 100% full (2m inodes) to 35% simply by cleaning out sessions older than 5 days.
This really shouldn't need to be done by your customers, or their SA's. You implemented this bug, please fix it.
This isn't just one server, it's been seen multiple times tonight, multiple times over the past few months. It's irresponsible to just let this go for so long.
-
Hi, Which version of cPanel & WHM are you seeing this behavior on? scripts/clean_user_php_sessions should be running every 20 minutes, or so, removing those session files. 0 -
This issue has apparently not been addressed even yet. ALL the sessions on my server are stored at: '/var/cpanel/php/sessions/ea-php73/' (and there are also 'ea-php??' dirs for earlier versions of PHP). I cannot find a file called 'scripts/clean_user_php_sessions'. I do have one called '/usr/local/cpanel/scripts/cleanphpsessions' and another called '/usr/local/cpanel/scripts/cleanphpsessions.php', but neither are running automatically. I am running cPanel/WHM version 100.0.5. The session storage location is not of my choosing, but is presumably set by EasyApache? I have tried setting up a cron job for 'cleanphpsessions.php' but I get an error message: ' PHP Fatal error: Uncaught Error: Call to undefined function sqlite_open() in /home/webaditu/public_html/control/cleanphpsessions.php:10' I have also attempted to set up a cron job to run my own shell script, but I have found it impossible to change the ownership and/or permissions on the session files so that I can delete them. How can I delete outdated sessions automatically? 0 -
@ramasaig It looks like the script is different now in 2021; can you let me know if this article helps? How to clean up session files 0 -
Thanks for your reply. This post has been overtaken by events. I did eventually find the file 'clean_user_php_sessions' and it seems to be running as a cron job (as intended). I could not get it to send me an e-mail, and I now realise that this is because there's no output. I can edit it to print 'success' when the script is run in Putty, but is this suffient to generate an e-mail? LATER: I have been able to receive e-mails from 'Cron' by editing the script to print 'success'. I have learned much in the process of working all this out! 0
Please sign in to leave a comment.
Comments
4 comments