前提准备
例如服务应用:collectd,也可以类别其他服务如mysql、tomcat etc
测试centos系统:centos6.7和centos7.5
命令执行
centos6.7
启动collectd
service collectd start
设置开机自启
chkconfig collectd on
参考文档:
https://blog.csdn.net/qq_33468857/article/details/82023830
http://www.cnblogs.com/flcz/p/7691532.html
centos7.5
启动collectd
systemctl start collectd.service
设置开机自启
systemctl enable collectd.service
配置验证
Linux系统下如何查询程序是否开机就执行?
1、使用“chkconfig --list | grep collectd”命令来查看collectd服务是否开启。
参考文档
https://jingyan.baidu.com/article/3ea51489acd6f452e61bba3c.html
systemctl和service对比扩展
CentOS7中systemctl的使用与CentOS6中service的区别?
参考文档
https://blog.csdn.net/qq_38265137/article/details/83081881