prdatur / phpminer

PHPMiner is a web interface for cgminer on linux machines
Other
34 stars 15 forks source link

[ENHANCEMENT] Add PID file to cron.php #8

Closed nicoschtein closed 10 years ago

nicoschtein commented 10 years ago

I have an issue with multiple instances of cron.php running at the same time causing weird things:

15622 ?        S      0:00 /USR/SBIN/CRON
15625 ?        Ss     0:00 /bin/sh -c php -f /var/phpminer/cron.php > /var/phpminer/cron.log 2>&1
15630 ?        S      0:00 php -f /var/phpminer/cron.php
16056 ?        S      0:00 /USR/SBIN/CRON
16058 ?        Ss     0:00 /bin/sh -c php -f /var/phpminer/cron.php > /var/phpminer/cron.log 2>&1
16062 ?        S      0:00 php -f /var/phpminer/cron.php
16177 ?        S      0:00 /USR/SBIN/CRON
16179 ?        Ss     0:00 /bin/sh -c php -f /var/phpminer/cron.php > /var/phpminer/cron.log 2>&1
16183 ?        S      0:00 php -f /var/phpminer/cron.php
16615 ?        S      0:00 /USR/SBIN/CRON
16619 ?        Ss     0:00 /bin/sh -c php -f /var/phpminer/cron.php > /var/phpminer/cron.log 2>&1
16626 ?        S      0:00 php -f /var/phpminer/cron.php
16760 ?        S      0:00 /USR/SBIN/CRON
16763 ?        Ss     0:00 /bin/sh -c php -f /var/phpminer/cron.php > /var/phpminer/cron.log 2>&1
16766 ?        S      0:00 php -f /var/phpminer/cron.php

I suggest adding a PID file and check for existence of file then process, before running cron script.

prdatur commented 10 years ago

Normally the cronjob should not hang so long. Can you check where it hangs? I will add the pid feature also