sentora / sentora-core

Sentora is a web hosting control panel written in PHP for *NIX
GNU General Public License v3.0
653 stars 444 forks source link

Bug in centos 6 cron job #51

Closed MBlagui closed 9 years ago

MBlagui commented 10 years ago

https://github.com/sentora/sentora-core/blob/master/etc/build/config_packs/centos_6/cron/zdaemon

This is buggy as you can see calls php55 that's wrong and to avoid any issue better we call cron

php /etc/zpanel/panel/bin/daemon.php to avoid any issues.

CRON IS NOT RUNNING as the patch in cron job is WRONG. Run it manually ( disable the output redirection and enjoy the FILE NOT FOUND).

M B

MBlagui commented 10 years ago

Old zdaemon used before:

SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ /5 * * * \ root nice -2 /usr/bin/php -q /etc/zpanel/panel/bin/daemon.php >> /dev/null 2>&1

see the path and the current one used with centos 6 & later centos 7

SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/rh/php55/root/usr/bin:/opt/rh/php55/root/usr/sbin MAILTO=root HOME=/ MANPATH=/opt/rh/php55/root/usr/share/man:${MANPATH} /5 * * * \ root nice -2 /opt/rh/php55/root/usr/bin/php -q /etc/zpanel/panel/bin/daemon.php >> /dev/null 2>&1

the path is wrong here and won't work. After install cron will not run.

MBlagui commented 10 years ago

2 reports already and mainly in centos 6...

http://forums.sentora.org/showthread.php?tid=325

http://forums.sentora.org/showthread.php?tid=294

M B

iTpain commented 10 years ago

The bug continue on centos 7 but i cant seam to find the cron.d/ on centos 7 x64

Caffe1neAdd1ct commented 10 years ago

use the crontab -u root -e command to access and edit

iTpain commented 10 years ago

i get

no crontab for root - using a empty one

Caffe1neAdd1ct commented 10 years ago

Try running:

sudo crontab -l -u apache> /tmp/mycron; echo "*/5 * * * * nice -2 php -q /etc/zpanel/panel/bin/daemon.php >> /etc/zpanel/daemon_last_run.log 2>&1" >> /tmp/mycron; sudo crontab -u apache /tmp/mycron; sudo rm -f /tmp/mycron
iTpain commented 10 years ago

i try it the solutions

sudo crontab -l -u apache> /tmp/mycron; echo "/5 * * * \ nice -2 php -q /etc/zpanel/panel/bin/daemon.php >> /etc/zpanel/daemon_last_run.log 2>&1" >> /tmp/mycron; sudo crontab -u apache /tmp/mycron; sudo rm -f /tmp/mycron

i get

no crontab for apache

After i run the latest comand and i rebot my vps i can't get apache to work anymore

MBlagui commented 10 years ago

yum install cronie Before the command. we are adding this package to installer

thejae commented 10 years ago

New install on CentOS 6.5 today, confirming this bug is still present.

MBlagui commented 10 years ago

thanks to confirm the installer you used @thejae because we are working on new installer/config pack if you want to beta test you are welcome to PM me in the forums Me.B.

thejae commented 10 years ago

@MBlagui I used the instruction posted here http://docs.sentora.org/ which is bash <(curl -LSs https://raw.githubusercontent.com/sentora/sentora-installers/master/sentora_install_centos.sh)

Seems like I managed to fix the problem at the moment. Here is what I did:

     # crontab -e
     */5 * * * * root /usr/bin/php -q /etc/zpanel/panel/bin/daemon.php >> /dev/null 2>&1

Thanks for the offer, i'll PM you on the forums.

ofirattia commented 9 years ago

Hi, see this issue I closed maybe it will help you. https://github.com/sentora/sentora-core/issues/151