バージョン5.0.0以降、公式パッケージのZabbixエージェントのsystemdサービスファイルが更新され、ユーザー
とグループ
のディレクティブが明示的に含まれるようになりました。どちらもzabbix
に設定されています。
これは、zabbix_agentd.conf
ファイルを介してどのユーザーZabbixエージェントを実行するかを構成する古い機能がバイパスされ、エージェントが常にsystemdサービスファイルで指定されたユーザーとして実行されることを意味します。
この新しい動作を上書きして旧来のようにrootで実行するには、次の内容で/etc/systemd/system/zabbix-agent.service.d/override.conf
ファイルを作成します。
次にデーモンをリロードし、zabbix-agentサービスを再起動します。
Zabbixエージェント2の場合、これで実行されるユーザーを決定します。
古いエージェントの場合、上記だけではzabbix_agentd.conf
ファイルでのユーザー設定する機能のみを再度有効にするだけなので、zabbixエージェントをrootとして実行するには、エージェント構成ファイルを編集し、User=root
とAllowRoot=1
オプションを追加で指定する必要があります。
To override the default user and group for Zabbix agent, run:
Then, add the following content:
Reload daemons and restart the zabbix-agent service:
For Zabbix agent this re-enables the functionality of configuring user in the zabbix_agentd.conf
file. Now you need to set User=root
and AllowRoot=1
configuration parameters in the agent configuration file.
To override the default user and group for Zabbix agent 2, run:
Then, add the following content:
Reload daemons and restart the zabbix-agent service:
For Zabbix agent2 this completely determines the user that it runs as. No additional modifications are required.