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

Published 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

标题:zabbix编译安装时的systemctl启动管理
作者:cuijianzhe
地址:https://cuijianzhe.github.io/articles/2021/10/28/1635404018903.html