[ZBX-17306] Zabbix Agent fails to start on Ubuntu 14.04 Created: 2020 Feb 12 Updated: 2024 Apr 10 Resolved: 2020 Jul 14 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Documentation (D) |
Affects Version/s: | 4.0.17 |
Fix Version/s: | 5.0 (plan) |
Type: | Problem report | Priority: | Trivial |
Reporter: | Lukas Jelinek | Assignee: | Jurijs Klopovskis |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Team: | |
Sprint: | Sprint 62 (Mar 2020), Sprint 63 (Apr 2020), Sprint 64 (May 2020), Sprint 65 (Jun 2020), Sprint 66 (Jul 2020) |
Description |
Steps to reproduce:
Result:
According to my investigation, the problem is in /etc/init.d/zabbix-agent which is different than in 4.0.16. There are these new lines: if [ -n "$ZABBIX_AGENT_USER" ]; then This is probably buggy because -c should specify a configuration file and not an user. |
Comments |
Comment by Lukas Jelinek [ 2020 Feb 12 ] |
Please look into /etc/default/zabbix-agent for these lines: # User to run zabbix agent as This is the evidence that the init script can't work properly. |
Comment by Jurijs Klopovskis [ 2020 Feb 13 ] |
The -c option is passed to start-stop-daemon in the init script.
# start-stop-daemon --help
...
-c|--chuid <name|uid[:group|gid]> change to this user/group before starting process
...
I've checked. It works fine with default configuration. root@ubuntu1404:~# service zabbix-agent status * zabbix_agentd is running root@ubuntu1404:~# ps aux | grep zabbix zabbix 1831 0.0 0.0 92612 2528 ? S 10:54 0:00 /usr/sbin/zabbix_agentd zabbix 1832 0.0 0.0 92612 2776 ? S 10:54 0:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec] zabbix 1834 0.0 0.1 92612 4184 ? S 10:54 0:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection] zabbix 1835 0.0 0.1 92612 4184 ? S 10:54 0:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection] zabbix 1836 0.0 0.1 92612 4184 ? S 10:54 0:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection] zabbix 1837 0.0 0.1 92612 4944 ? S 10:54 0:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec] root 1850 0.0 0.0 11764 2128 pts/0 S+ 10:55 0:00 grep --color=auto zabbix root@ubuntu1404:~# service zabbix-agent stop * Stopping Zabbix agent zabbix_agentd [ OK ] root@ubuntu1404:~# service zabbix-agent status * zabbix_agentd is not running root@ubuntu1404:~# ps aux | grep zabbix root 1875 0.0 0.0 11760 2196 pts/0 S+ 10:55 0:00 grep --color=auto zabbix root@ubuntu1404:~# service zabbix-agent start * Starting Zabbix agent zabbix_agentd [ OK ] root@ubuntu1404:~# service zabbix-agent status * zabbix_agentd is running root@ubuntu1404:~# ps aux | grep zabbix zabbix 1890 0.0 0.0 92612 2500 ? S 10:55 0:00 /usr/sbin/zabbix_agentd zabbix 1892 0.0 0.0 92612 2712 ? S 10:55 0:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec] zabbix 1893 0.0 0.1 92612 4320 ? S 10:55 0:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection] zabbix 1894 0.0 0.1 92612 4320 ? S 10:55 0:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection] zabbix 1895 0.0 0.1 92612 4320 ? S 10:55 0:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection] zabbix 1896 0.0 0.1 92612 4924 ? S 10:55 0:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec] root@ubuntu1404:~# tail -f /var/log/zabbix/zabbix_agentd.log 1890:20200213:105549.502 TLS support: YES 1890:20200213:105549.502 ************************** 1890:20200213:105549.502 using configuration file: /etc/zabbix/zabbix_agentd.conf 1890:20200213:105549.503 agent #0 started [main process] 1892:20200213:105549.504 agent #1 started [collector] 1893:20200213:105549.505 agent #2 started [listener #1] 1894:20200213:105549.506 agent #3 started [listener #2] 1895:20200213:105549.506 agent #4 started [listener #3] 1896:20200213:105549.509 agent #5 started [active checks #1] 1896:20200213:105549.516 active check configuration update from [127.0.0.1:10051] started to fail (cannot connect to [[127.0.0.1]:10051]: [111] Connection refused) The problem must be with something else. |
Comment by Jurijs Klopovskis [ 2020 Feb 13 ] |
What alterations did you make in /etc/zabbix/zabbix_agentd.conf? |
Comment by Lukas Jelinek [ 2020 Feb 17 ] |
We use this specific configuration (User is not altered): PidFile=/var/run/zabbix/zabbix_agentd.pid And the files included by Include contain only UserParameter lines (which vary between different servers). The config listed above works well with 4.0.16 and older versions. |
Comment by Lukas Jelinek [ 2020 Feb 26 ] |
Resolved in 4.0.18, closing the issue. |
Comment by Multazim Deshmukh [ 2020 Mar 18 ] |
Today i upgraded to 4.0.18 yet this issue is not resolved. Please reopen the ticket. OS : Ubuntu 14.04.5 LTS I ran init script in debug mode. Here is the output: root@capl-attrib01:~# sh -x /etc/init.d/zabbix-agent start root@capl-attrib01:~# sh -x /etc/init.d/zabbix-agent status looks like it doesn't run start-stop-daemon at all. can someone please help me understand & resolve the issue. when i manually run start-stop-daemon, It starts. root@capl-attrib01:~# start-stop-daemon -c zabbix --oknodo --start --pidfile /var/run/zabbix/zabbix_agentd.pid --exec /usr/sbin/zabbix_agentd >/dev/null 2>&1 |
Comment by dimir [ 2020 Mar 18 ] |
You should have the rights to re-open the ticket? |
Comment by Multazim Deshmukh [ 2020 Mar 18 ] |
I don't have rights to reopen this ticket. |
Comment by dimir [ 2020 Mar 18 ] |
I'll try to get it some attention. |
Comment by Lukas Jelinek [ 2020 Mar 18 ] |
Re-opened as requested by Deshmukh. |
Comment by Multazim Deshmukh [ 2020 Mar 20 ] |
root@capl-attrib01:~# bash -x /usr/sbin/service zabbix-agent status |
Comment by Multazim Deshmukh [ 2020 Mar 20 ] |
I moved /etc/init/zabbix-agent.conf to /tmp/ and init script works, so this config file maybe source of the issue. |
Comment by Jurijs Klopovskis [ 2020 Mar 20 ] |
Deshmukh, can you please share the output of dpkg-query -L zabbix-agent We only provide old style init file in /etc/init.d/zabbix_agent on trusty. Therefore I'm confused by the /etc/init/zabbix-agent.conf upstart config file on your system. |
Comment by Multazim Deshmukh [ 2020 Mar 20 ] |
root@capl-attrib01:~# zabbix_agentd -V Copyright (C) 2020 Zabbix SIA This product includes software developed by the OpenSSL Project Compiled with OpenSSL 1.0.1f 6 Jan 2014 |
Comment by Multazim Deshmukh [ 2020 Mar 20 ] |
root@capl-attrib01:~# dpkg-query -L zabbix-agent |
Comment by Multazim Deshmukh [ 2020 Mar 20 ] |
So i was on Zabbix agent 2.2.23 and then i performed upgrade using these steps. wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+trusty_all.deb |
Comment by Multazim Deshmukh [ 2020 Mar 20 ] |
Output of following command doesn't has /etc/init/zabbix-agent.conf dpkg-query -L zabbix-agent Was this a residual file of Zabbix agent 2.2 ?
|
Comment by Jurijs Klopovskis [ 2020 Mar 20 ] |
Yes. This seems to be part of zabbix-agent provided by debian. Our official zabbix-4.0 one overrode it. |
Comment by Multazim Deshmukh [ 2020 Mar 20 ] |
Indeed. This was a residual file of debian maintained zabbix agent 2.2.x version. I verified the same by downloading a package from ubuntu website. ubuntu@accessdev1:~$ dpkg -c zabbix-agent_2.2.2+dfsg-1ubuntu1_amd64.deb | grep zabbix-agent.conf why didn't 4.0 remove that file if it doesn't need it? is that the way --only-upgrade normally behaves ? |
Comment by Jurijs Klopovskis [ 2020 Mar 20 ] |
I've checked. It seems that even simply running apt remove zabbix-agent leaves residual configuration files, regardless of whether they were modified by the user or not. That's why /etc/init/zabbix-agent.conf was left there. |
Comment by Multazim Deshmukh [ 2020 Mar 20 ] |
Please check if apt-get purge zabbix-agent helps. I suggest you to make necessary changes in agent upgrade documentation to reflect these findings. |
Comment by Jurijs Klopovskis [ 2020 Mar 20 ] |
Yes, of course it does help. But beware that this will also purge your /etc/zabbix/zabbix.conf file, including any changes that you may have made.
We definitely will. |
Comment by Marina Generalova [ 2020 Jul 03 ] |
Documentation updated:
|