[ZBX-10823] Zabbix agent hang when I do manual service start/stop Created: 2016 May 19  Updated: 2017 May 30  Resolved: 2016 Jul 11

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: 3.0.2
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Thomas Lau Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: agent, upstart
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux breve 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty



 Description   
root@breve:~# ps aux | grep zabbix_agentd
zabbix    1163  0.0  0.0  99408  1512 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
zabbix    1165  0.0  0.0  99408  2788 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec]          
zabbix    1166  0.0  0.0 103540  2832 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix    1167  0.0  0.0 103540  2740 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix    1168  0.0  0.0 103540  2740 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
zabbix    1169  0.0  0.0 103668  2620 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]   
root      2824  0.0  0.0  11940   944 pts/2    S+   09:36   0:00 grep --color=auto zabbix_agentd
root@breve:~# uptime
 09:36:53 up 0 min,  1 user,  load average: 0.78, 0.26, 0.09

root@breve:~# service zabbix-agent stop

then it hangs from there, and I checked from other console, zabbix_agentd not yet killed:

root@breve:/var/log/upstart# ps aux | grep zabbix_agentd
zabbix    1163  0.0  0.0  99408  1512 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
zabbix    1165  0.0  0.0  99408  3276 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec]          
zabbix    1166  0.0  0.0 103664  2888 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix    1167  0.0  0.0 103664  2836 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix    1168  0.0  0.0 103664  2888 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
zabbix    1169  0.0  0.0 103668  2716 ?        S    09:36   0:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]   
root      2932  0.0  0.0  11940   940 pts/9    S+   09:39   0:00 grep --color=auto zabbix_agentd

/var/log/upstart/zabbix-agent.log is empty, here is Upstart script from Zabbix package:

# Upstart job to start the zabbix agent

description "Zabbix agent"
author "Christian Kampka <[email protected]>"

start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]

expect daemon

respawn

# wait for agent to properly disconnect from server before killing it
kill timeout 30

console log

env DIR="/var/run/zabbix"

pre-start script

  # stop job from continuing if no config file found for daemon
  [ ! -f /etc/default/zabbix-agent ] && { stop; exit 0; }

  # source the config file
  . /etc/default/zabbix-agent

  # stop job from continuing if admin has not enabled service in
  # config file.
  [ "x$START" = "xyes" ] || { stop; exit 0; }

  [ -d "$DIR" ] || mkdir "$DIR"
  chown -R zabbix:zabbix "$DIR"

end script

script
  . /etc/default/zabbix-agent

  exec /usr/sbin/zabbix_agentd -c $CONFIG_FILE
end script

Zabbix agent package detail:

Package: zabbix-agent
Status: install ok installed
Priority: optional
Section: unknown
Installed-Size: 458
Maintainer: Koadi Terashima <[email protected]>
Architecture: amd64
Source: zabbix
Version: 1:3.0.2-1+trusty
Depends: libc6 (>= 2.17), libcurl3 (>= 7.16.2), libldap-2.4-2 (>= 2.4.7), libssl1.0.0 (>= 1.0.1), adduser, lsb-base
Suggests: logrotate
Conffiles:
 /etc/logrotate.d/zabbix-agent 41cd329ede4b2ca47fb3bd85196da6d6
 /etc/zabbix/zabbix_agentd.conf 7da30ffecd49619eaf13c00e55813dc6
 /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf 1679b8aa367bae0ab42c13e75be669ab
 /etc/init.d/zabbix-agent 12aee375be60a60bc5dce27296455cfa
 /etc/init/zabbix-agent.conf 5023e0dddb327a831386538145d6b3ba obsolete
 /etc/default/zabbix-agent 8c6078dd384df76407933a75a9c3d962 obsolete
Description: Zabbix network monitoring solution - agent
 Zabbix is the ultimate enterprise-level software designed for
 real-time monitoring of millions of metrics collected from tens of
 thousands of servers, virtual machines and network devices.
 .
 This package provides the software needed to monitor a host using a
 Zabbix agent.
Homepage: http://www.zabbix.com


 Comments   
Comment by Thomas Lau [ 2016 May 23 ]

Small update,

After checking in detail, /etc/init/zabbix-agent.conf and /etc/init.d/zabbix-agent coexists; My theory is: 1. possible conflict because of coexists file; 2. buggy /etc/init/zabbix-agent.conf setup

Zabbix agent from Zabbix offical repo is using /etc/init.d/zabbix-agent, I think /etc/init/zabbix-agent.conf is coming from Ubuntu offical repo Zabbix 2.x, which didn't purge properly and cause this issue.

If I manually remove /etc/init/zabbix-agent.conf, zabbix agent could start and stop properly.

Comment by Kodai Terashima [ 2016 May 23 ]

Our ubuntu package doesn't provide upstart script. service command uses upstart script instead of zabbix-agent.init.

Comment by Thomas Lau [ 2016 May 23 ]

would it be possible to delete /etc/init/zabbix-agent.conf when install from Zabbix offical repo?

Comment by Kodai Terashima [ 2016 May 24 ]

Our package itself does not have such function. Maybe it's possible to do it somehow, by setting dpkg configuration, etc. but I'm not sure exactly.

Comment by Kodai Terashima [ 2016 Jul 11 ]

I'm closing this issue, suppose this is not our package problem.

Generated at Mon Jun 02 16:55:11 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.