Update service units

* Use Type=simple and add --foreground
* Better resources limits
* Better system protection for proxy and server
tags/zabbix-4.0.2-2
Daniel Berteaud 6 years ago
parent 7a81d60e9e
commit a9cadef53b
  1. 5
      zabbix-agent.service
  2. 16
      zabbix-proxy.service
  3. 15
      zabbix-server.service

@ -3,9 +3,8 @@ Description=Zabbix Monitoring Agent
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
PIDFile=/var/run/zabbix/zabbix_agentd.pid
Type=simple
ExecStart=/usr/sbin/zabbix_agentd --config /etc/zabbix/zabbix_agentd.conf --foreground
Restart=always
User=zabbix
Group=zabbix

@ -3,16 +3,18 @@ Description=Zabbix Proxy
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/usr/sbin/zabbix_proxy -c /etc/zabbix/zabbix_proxy.conf
Type=simple
ExecStart=/usr/sbin/zabbix_proxy --cconfig /etc/zabbix/zabbix_proxy.conf --foreground
ExecReload=/usr/sbin/zabbix_proxy -R config_cache_reload
PIDFile=/var/run/zabbix/zabbix_proxy.pid
PrivateTmp=yes
CPUShares=512
MemoryLimit=50M
MemoryLimit=500M
BlockIOWeight=500
InaccessibleDirectories=/home
ReadOnlyDirectories=/etc /usr
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
NoNewPrivileges=yes
Restart=always
[Install]
WantedBy=multi-user.target

@ -3,15 +3,16 @@ Description=Zabbix Server
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
Type=simple
ExecStart=/usr/sbin/zabbix_server --config /etc/zabbix/zabbix_server.conf --foreground
ExecReload=/usr/sbin/zabbix_server -R config_cache_reload
PIDFile=/var/run/zabbix/zabbix_server.pid
PrivateTmp=yes
MemoryLimit=500M
MemoryLimit=2048M
BlockIOWeight=500
InaccessibleDirectories=/home
ReadOnlyDirectories=/etc /usr
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
NoNewPrivileges=yes
[Install]
WantedBy=multi-user.target

Loading…
Cancel
Save