当我在ubuntu上以root身份运行这样的m脚本时,它可以工作:
./my_celery.sh
但是当它与Upstart一起运行时,它不会执行任务:
暴发户:
description "Django instance"
start on runlevel [2345]
stop on runlevel [06]
respawn
respawn limit 10 5
exec /var/www/webapps/myapp/my_celery.sh
启动它:
service my_celery start
日志:
[2015-07-20 11:56:46,563: INFO/MainProcess] Scheduler: Sending due task The Parmalat Daily Report (minamobime_coza.tasks.parmalat_report)
永远不会执行任务
答案 0 :(得分:0)
我无法让新手开办芹菜工人 - 事实上,新贵从来没有完全兑现承诺。
我建议使用supervisord代替upstart来管理芹菜工作者 - 示例配置文件:
$query = "select * FROM `$table`.`channels` WHERE `country`='vietnam' ORDER BY `chanid`";
$result = mysql_query($query,$db) or die(mysql_error());
$data = array();
while($row = mysql_fetch_array($result)) {
$chanid = $row['chanid'];
$data[navtitle] = "$chanid - $row[title]";
$data[navurl] = "http://www.localhost.com/vietnam.php?chanid=$row[chanid]&country=$row[country]";
$data[vid_art] = "$chanart";
}
$array2=array_merge(array($array,array($data));
$JSON=json_encode($array2);
echo $JSON;
/etc/supervisor.d/celery.conf