zabbix编译安装时的systemctl启动管理

Updated on with 0 views and 0 comments

Server 端

[Unit]
Description=Zabbix Server
After=syslog.target
After=network.target


[Service]
Environment="CONFFILE=/usr/local/zabbix/etc/zabbix_server.conf"
EnvironmentFile=-/usr/local/zabbix
Type=forking
PIDFile=/var/run/zabbix/zabbix_server.pid
ExecStart=/usr/local/zabbix/sbin/zabbix_server -c /usr/local/zabbix/etc/zabbix_server.conf
ExecStop=/usr/bin/kill  $MAINPID
Restart=always
RestartSec=5
User=zabbix
Group=zabbix

[Install]
WantedBy=multi-user.target

agentd 端

[Unit]
Description=Zabbix Agent 
After=syslog.target
After=network.target


[Service]
Environment="CONFFILE=/usr/local/zabbix/etc/zabbix_agentd.conf"
EnvironmentFile=-/usr/local/zabbix
Type=forking
PIDFile=/var/run/zabbix/zabbix_agentd.pid
ExecStart=/usr/local/zabbix/sbin/zabbix_agentd -c /usr/local/zabbix/etc/zabbix_agentd.conf
ExecStop=/usr/bin/kill  $MAINPID
Restart=always
RestartSec=5
User=zabbix
Group=zabbix

[Install]
WantedBy=multi-user.target

我的博客即将同步至腾讯云 + 社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=4xzkse86a7o3


标题:zabbix编译安装时的systemctl启动管理
作者:cuijianzhe
地址:https://solo.cjzshilong.cn/articles/2022/06/13/1655119921370.html

到头来 我们记住的 不是敌人的攻击 而是朋友的沉默 ---马丁·路德·金