File systemd service cho Zabbix Server trên CentOS/RHEL 7
Nội dung của bài viết này chủ yếu là note lại nội dung của file systemd service dành cho dịch vụ Zabbix Server v2.0 -> 3.0 (được compile từ source) trên các hệ điều hành Linux sử dụng systemd như Fedora 16/17, CentOS/RedHat 7,…
Ta sẽ tạo file zabbix_server.service ở đường dẫn thư mục quản lý dịch vụ bởi systemctl : /lib/systemd/system/
Lưu ý :
– Nhớ kiểm tra lại đường dẫn các file binary như “/usr/local/sbin/zabbix_server” và PID Zabbix Server file “/var/run/zabbix/zabbix_server.pid” có thể khác nhau trên từng hệ điều hành hoặc theo cấu hình trong file cấu hình dành cho dịch vụ Zabbix Server của các bạn.
# vi /lib/systemd/system/zabbix_server.service
[Unit] Description=Zabbix Server After=syslog.target network.target mysqld.service [Service] Type=oneshot ExecStart=/usr/local/sbin/zabbix_server -c /usr/local/etc/zabbix_server.conf ExecReload=/usr/local/sbin/zabbix_server -R config_cache_reload RemainAfterExit=yes PIDFile=/var/run/zabbix/zabbix_server.pid [Install] WantedBy=multi-user.target
Như vậy là xong file systemd service dành cho dịch vụ Zabbix Server trên CentOS/Redhat 7 .