[solved]session not cleared in Debian 10

Discussion in 'ISPConfig 3 Priority Support' started by elmacus, Mar 2, 2020.

Tags:
  1. elmacus

    elmacus Active Member HowtoForge Supporter

    Hi.
    Sessions file not cleared in Debian 10.
    The problem seems to be that /var/www/clients/clientXX/webYYY/tmp does not get cleaned on all servers in cluster.
    Found this similar:
    https://www.howtoforge.com/communit...l-tmp-sessions-not-deleted.41752/#post-344256
    But now i have websites with 2 million sess_xxxxxx in tmp/ and its hard to delete.
    This started after upgrade to Debian 10 in september 2019.
    I have /etc/cron.d/php that contains:
    09,39 * * * * root [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi
    Its running:
    Mar 2 13:39:01 mail11 CRON[5832]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
    Mar 2 13:39:03 mail11 systemd[1]: phpsessionclean.service: Succeeded.
    Mar 2 13:39:03 mail11 systemd[1]: Started Clean php session files.

    Anyone had similar error and solved it ?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    elmacus likes this.
  3. elmacus

    elmacus Active Member HowtoForge Supporter

    For anyone else that have trouble deleting many files, this worked:
    cd in to tmp/, then run:
    find . -name "sess*" -delete
     
  4. elmacus

    elmacus Active Member HowtoForge Supporter

    After trying hotfixing this on one node (not also master) i cant confirm that it works, still old session from yesterday.
    I did restart Apache2, but nothing else.
    Are there any extra steps to make it work ? Tried also to restart cron.service right now.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    The code from the bugfix works fine, it uses find to delete only old session files, not all session files.
     
  6. elmacus

    elmacus Active Member HowtoForge Supporter

    find . -mtime +1 -name 'sess_*'
    Gives me zero hits.
    Ok, from man:
    -mtime n File's data was last modified n*24 hours ago
    So code clears sess_* older than 24 hours ? Thats ok if working. Will try tomorrow again then.
     
  7. elmacus

    elmacus Active Member HowtoForge Supporter

    "-mtime +1" gives me approx 2.5 days for sessionsfiles, so it works ok. Thanks.
     
    till likes this.

Share This Page