Debian Wheezy - Daily Cron Error (/etc/cron.d/php5)

  • Hello guys,
    I receive daily the following cronjob error:

    Code
    1. Segmentation faultfind: invalid argument `-delete' to `-cmin'


    It seems that the command who generates that is the following:


    Code
    1. Subject: Cron <[email protected]> [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/lib/php5 ] && /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime)

    The Corn Job is defined here:

    Code
    1. # /etc/cron.d/php5: crontab fragment for php5
    2. # This purges session files older than X, where X is defined in seconds
    3. # as the largest value of session.gc_maxlifetime from all your php.ini
    4. # files, or 24 minutes if not defined. See /usr/lib/php5/maxlifetime
    5. # Look for and purge old sessions every 30 minutes
    6. 09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/lib/php5 ] && /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime)

    Is that i-MSCP related or just on my setup ?


    My system:
    Debian Wheezy x64
    PHP FPM
    i-MSCP 1.2.11


    If you need any further info, please let me know.
    Thank you, bye Kess.

  • @kess


    Hello,


    This cron task is not used nor provided by i-MSCP. That is the default cron task provided by the php5-common debian package:


    Code
    1. [email protected]:/usr/local/src/imscp# apt-file search /etc/cron.d/php5php5-common: /etc/cron.d/php5


    This cron task is responsible to purge PHP session files when you use the default PHP configuration which is not the case with i-MSCP. Thus, you can disable this cron task safetely by running the following command:

    Code
    1. # mv /etc/cron.d/php5 /etc/cron.d/php5.disabled


    Once done, the problem should be gone.


    Note: You could also open an issue on the Debian bug tracker about this problem.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Hi @Nuxwin,
    thank you very much for the fast reply.


    I think I'm going to disable that job. I'll then decide if it's the case to re-enable it when I'll upgrade to Jessie in the next weeks.


    Thank you :-)

  • @kess


    Can you please give us the output of the following command on your wheezy system?:


    Code
    1. # grep -nr 'session.gc_maxlifetime' /etc/php5/

    Thanks.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • As requested :-)

    Code
    1. /etc/php5/fpm/php.ini:1482:session.gc_maxlifetime = 1440
    2. /etc/php5/fpm/php.ini:1489:; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
    3. /etc/php5/fpm/php.ini.ucf-dist:1415:session.gc_maxlifetime = 1440
    4. /etc/php5/fpm/php.ini.ucf-dist:1422:; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
    5. /etc/php5/cgi/php.ini:1415:session.gc_maxlifetime = 1440
    6. /etc/php5/cgi/php.ini:1422:; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
    7. /etc/php5/cli/php.ini:1415:session.gc_maxlifetime = 1440
    8. /etc/php5/cli/php.ini:1422:; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
    9. /etc/php5/embed/php.ini:1415:session.gc_maxlifetime = 1440
    10. /etc/php5/embed/php.ini:1422:; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
  • @kess


    Also the content of /usr/lib/php5/sessionclean please ;)


    Shell-Script
    1. # cat /usr/lib/php5/sessionclean


    Thanks.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @Nuxwin, voilà

    Shell-Script
    1. #!/bin/sh
    2. # first find all used files and touch them (hope it's not massive amount of files)
    3. [ -x /usr/bin/lsof ] && /usr/bin/lsof -w -l +d "${1}" | awk -- '{ if (NR > 1) { print $9; } }' | xargs -i touch -c {}
    4. # find all files older then maxlifetime
    5. find "${1}" -depth -mindepth 1 -maxdepth 1 -ignore_readdir_race -type f -cmin "+${2}" -delete
  • @kess


    Sorry, also the content from /usr/lib/php5/maxlifetime ;)


    Shell-Script
    1. # cat /usr/lib/php5/maxlifetime


    Then, I'll be able to invetigate. ;)


    Thanks.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Here we go...

  • @kess


    Last thing ;) Can you run the /usr/lib/php5/maxlifetime script manually and give us the output?


    Shell-Script
    1. # sh /usr/lib/php5/maxlifetime


    Thanks.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206