Browse Source

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 1 year ago
parent
commit
a9cadef53b
3 changed files with 19 additions and 17 deletions
  1. +2
    -3
      zabbix-agent.service
  2. +9
    -7
      zabbix-proxy.service
  3. +8
    -7
      zabbix-server.service

+ 2
- 3
zabbix-agent.service View File

@@ -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


+ 9
- 7
zabbix-proxy.service View File

@@ -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

+ 8
- 7
zabbix-server.service View File

@@ -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