首页 > 系统服务 > 详细

daemonize Unix系统后台守护进程管理软件

时间:2020-04-13 00:55:12      阅读:429      评论:0      收藏:0      [点我收藏+]
在我们的工作中,很多时候都需要在linux中后台运行程序,
方法1: nohup &

方法2:
daemonize Unix系统后台守护进程管理软件
优点:更加正规 后台运?更稳定
git clone git://github.com/bmc/daemonize.git
sh configure && make && sudo make install
[root@dev-hadoop-test01 ~]# which daemonize
/usr/local/sbin/daemonize

daemonize -c /data/prometheus/ /data/prometheus/up.sh
-c 是指定运?路径
/data/prometheus/up.sh 是运?路径下的 ?个启动脚本
下?是这个启动脚本的内容
内容:就是开启prometheus进程
[root@prometheus yd]# cat??/data/prometheus/up.sh
/data/prometheus/prometheus --web.listenaddress="0.0.0.0:9090"????????--web.read-timeout=5m????--web.maxconnections=10??--storage.tsdb.retention=15d??--storage.tsdb.path="data/"???--query.max-concurrency=20???--query.timeout=2m
生产上就用这的参数去启动prometheus

方法3:安装screen?具 放?后台运?
screen还有另外?个好处 就是 可以随时切换进? 程序前台窗
? 查看各种调试信息

screen 也有不好的地?
? 不够正规化 总觉得还是个临时办法
? screen -l 提供的后台 列表 不够?性化,很多时候 你记不住 到底哪个是哪个
? 很容易被误关闭 操作的时候 ctrl +ad / ctrl +d 不??操作错了 直接就退出去了..

不推荐生产上用,测试可以用

亲测可行,推荐可以使用 方法1 方法2

daemonize Unix系统后台守护进程管理软件

原文:https://blog.51cto.com/12445535/2486723

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!