Giter Site home page Giter Site logo

Comments (1)

EatApples avatar EatApples commented on August 22, 2024

task_proc_watcher.sh脚本内"ps -fC java | grep $process_flag | wc -l" 此行代码在mac系统不支持"ps -fC java "。

(1)因为不识别 "-C" 参数,在 if 判断进程的个数时进入重启逻辑,按理说,应该一分钟重启4次。
然而因为端口占用,重启的应用会死亡,但是重启的进程暂未消亡。

解决方案:判断进程的执行逻辑改为

count=`ps -ef | grep java | grep $process_flag | wc -l`

脚本run4config.sh保活功能可采用 */1 * * * * flock -xn file.lock -c ''实现

(2)flock文件锁只是预防定时任务并行执行,而在保活脚本中,执行时长<60S,不会有并行执行问题。
即使并行执行了,只要判断进程的逻辑没问题,则保活脚本啥都不做。
总之,flock文件锁能解决crontab冲突问题,与保活脚本的正确性无关。

from sia-task.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.