Code Monkey home page Code Monkey logo

daemon's Introduction

daemon

这是一个shell脚本写的守护程序,负责启动、守护、管理“指定的命令“

#下载和安装 将daemon.sh下载到程序目录并给其授以运行权限chmod +x daemon.sh

#用法

进入程序目录

启动服务

./daemon.sh start "command" interval

关闭服务

./daemon.sh stop

注意: 所有操作必须要在程序所在目录完成

#日志 daemon会在程序目录产生4个文件

daemon.log —— 主程序日志

daemon.master.log —— 守护程序日志

daemon.pid —— 主程序PID文件

daemon.master.pid —— 守护程序PID文件

#gitignore 如果程序所在目录位于git仓库中,请在.gitignore文件中增加

*.pid
*.log

#为什么要做这个东西

  • 生产环境需要

  • forever、supervisor等太占内存

  • 我闲的蛋疼

daemon's People

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.