jjzjj

php - Cron 不会停止运行

coder 2024-04-21 原文

我在 Magento 上安装了 Aoe Scheduler,并注意到“系统备份”仍在运行将近一天。我尝试使用 Aoe Scheduler 中的 kill 选项终止进程,并在我的日志文件中获取:

2015-12-22T18:33:31+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 467
2015-12-22T18:34:02+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 453
2015-12-22T18:34:02+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 453
2015-12-22T18:34:32+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 467
2015-12-22T18:34:32+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 467
2015-12-22T18:35:03+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 453
2015-12-22T18:35:03+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 453

Schedule.php 文件有这个:

    // let's be nice first (a.k.a. "Could you please stop running now?")
    if (posix_kill($this->getPid(), SIGINT)) {
        $this->log(sprintf('Sending SIGINT to job "%s" (id: %s)', $this->getJobCode(), $this->getId()));
    } else {
        $this->log(sprintf('Error while sending SIGINT to job "%s" (id: %s)', $this->getJobCode(), $this->getId()), Zend_Log::ERR);
    }

    // check if process terminates within 30 seconds
    $startTime = time();
    while (($waitTime = (time() - $startTime) < 30) && $this->checkPid()) {
        sleep(2);
    }

    if ($this->checkPid()) {
        // What, you're still alive? OK, time to say goodbye now. You had your chance...
        if (posix_kill($this->getPid(), SIGKILL)) {
            $this->log(sprintf('Sending SIGKILL to job "%s" (id: %s)', $this->getJobCode(), $this->getId()));
        } else {
            $this->log(sprintf('Error while sending SIGKILL to job "%s" (id: %s)', $this->getJobCode(), $this->getId()), Zend_Log::ERR);
        }
    } else {
        $this->log(sprintf('Killed job "%s" (id: %s) with SIGINT. Job terminated after %s second(s)', $this->getJobCode(), $this->getId(), $waitTime));
    }

kill 不起作用,但我不明白为什么 cron 一开始还在运行!

最佳答案

也许回答有点晚,但我遇到了和你一样的问题。

经过一段时间的挫折后,我去了连接管理器并卸载了扩展,清理了所有缓存,注销并重新安装。 这对我有用,它现在运行正常。

恐怕我无法说出它有什么问题,只是它对我有用。

关于php - Cron 不会停止运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34422972/

有关php - Cron 不会停止运行的更多相关文章

  1. ruby - 如何从 ruby​​ 中的字符串运行任意对象方法? - 2

    总的来说,我对ruby​​还比较陌生,我正在为我正在创建的对象编写一些rspec测试用例。许多测试用例都非常基础,我只是想确保正确填充和返回值。我想知道是否有办法使用循环结构来执行此操作。不必为我要测试的每个方法都设置一个assertEquals。例如:describeitem,"TestingtheItem"doit"willhaveanullvaluetostart"doitem=Item.new#HereIcoulddotheitem.name.shouldbe_nil#thenIcoulddoitem.category.shouldbe_nilendend但我想要一些方法来使用

  2. ruby - 如何每月在 Heroku 运行一次 Scheduler 插件? - 2

    在选择我想要运行操作的频率时,唯一的选项是“每天”、“每小时”和“每10分钟”。谢谢!我想为我的Rails3.1应用程序运行调度程序。 最佳答案 这不是一个优雅的解决方案,但您可以安排它每天运行,并在实际开始工作之前检查日期是否为当月的第一天。 关于ruby-如何每月在Heroku运行一次Scheduler插件?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/8692687/

  3. ruby-on-rails - 如何在 ruby​​ 中使用两个参数异步运行 exe? - 2

    exe应该在我打开页面时运行。异步进程需要运行。有什么方法可以在ruby​​中使用两个参数异步运行exe吗?我已经尝试过ruby​​命令-system()、exec()但它正在等待过程完成。我需要用参数启动exe,无需等待进程完成是否有任何ruby​​gems会支持我的问题? 最佳答案 您可以使用Process.spawn和Process.wait2:pid=Process.spawn'your.exe','--option'#Later...pid,status=Process.wait2pid您的程序将作为解释器的子进程执行。除

  4. ruby - 无法运行 Rails 2.x 应用程序 - 2

    我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby​​:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r

  5. ruby - Highline 询问方法不会使用同一行 - 2

    设置:狂欢ruby1.9.2高线(1.6.13)描述:我已经相当习惯在其他一些项目中使用highline,但已经有几个月没有使用它了。现在,在Ruby1.9.2上全新安装时,它似乎不允许在同一行回答提示。所以以前我会看到类似的东西:require"highline/import"ask"Whatisyourfavoritecolor?"并得到:Whatisyourfavoritecolor?|现在我看到类似的东西:Whatisyourfavoritecolor?|竖线(|)符号是我的终端光标。知道为什么会发生这种变化吗? 最佳答案

  6. ruby-on-rails - 项目升级后 Pow 不会更改 ruby​​ 版本 - 2

    我在我的Rails项目中使用Pow和powifygem。现在我尝试升级我的ruby​​版本(从1.9.3到2.0.0,我使用RVM)当我切换ruby​​版本、安装所有gem依赖项时,我通过运行railss并访问localhost:3000确保该应用程序正常运行以前,我通过使用pow访问http://my_app.dev来浏览我的应用程序。升级后,由于错误Bundler::RubyVersionMismatch:YourRubyversionis1.9.3,butyourGemfilespecified2.0.0,此url不起作用我尝试过的:重新创建pow应用程序重启pow服务器更新战俘

  7. ruby - Sinatra:运行 rspec 测试时记录噪音 - 2

    Sinatra新手;我正在运行一些rspec测试,但在日志中收到了一堆不需要的噪音。如何消除日志中过多的噪音?我仔细检查了环境是否设置为:test,这意味着记录器级别应设置为WARN而不是DEBUG。spec_helper:require"./app"require"sinatra"require"rspec"require"rack/test"require"database_cleaner"require"factory_girl"set:environment,:testFactoryGirl.definition_file_paths=%w{./factories./test/

  8. ruby-on-rails - 无法让 rspec、spork 和调试器正常运行 - 2

    GivenIamadumbprogrammerandIamusingrspecandIamusingsporkandIwanttodebug...mmm...let'ssaaay,aspecforPhone.那么,我应该把“require'ruby-debug'”行放在哪里,以便在phone_spec.rb的特定点停止处理?(我所要求的只是一个大而粗的箭头,即使是一个有挑战性的程序员也能看到:-3)我已经尝试了很多位置,除非我没有正确测试它们,否则会发生一些奇怪的事情:在spec_helper.rb中的以下位置:require'rubygems'require'spork'

  9. ruby-on-rails - before_filter 运行多个方法 - 2

    是否有可能:before_filter:authenticate_user!||:authenticate_admin! 最佳答案 before_filter:do_authenticationdefdo_authenticationauthenticate_user!||authenticate_admin!end 关于ruby-on-rails-before_filter运行多个方法,我们在StackOverflow上找到一个类似的问题: https://

  10. Vscode+Cmake配置并运行opencv环境(Windows和Ubuntu大同小异) - 2

    之前在培训新生的时候,windows环境下配置opencv环境一直教的都是网上主流的vsstudio配置属性表,但是这个似乎对新生来说难度略高(虽然个人觉得完全是他们自己的问题),加之暑假之后对cmake实在是爱不释手,且这样配置确实十分简单(其实都不需要配置),故斗胆妄言vscode下配置CV之法。其实极为简单,图比较多所以很长。如果你看此文还配不好,你应该思考一下是不是自己的问题。闲话少说,直接开始。0.CMkae简介有的人到大二了都不知道cmake是什么,我不说是谁。CMake是一个开源免费并且跨平台的构建工具,可以用简单的语句来描述所有平台的编译过程。它能够根据当前所在平台输出对应的m

随机推荐