[ZBX-3519] inconsistencies and problems in system.run[] implementation Created: 2011 Feb 09  Updated: 2017 May 30  Resolved: 2011 Jun 30

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G), Server (S)
Affects Version/s: 1.8.4
Fix Version/s: 1.8.6, 1.9.5 (alpha)

Type: Incident report Priority: Major
Reporter: Aleksandrs Saveljevs Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

(1) Currently, we do not provide any guarantees as to whether child processes will be terminated if timeout is reached.

(2) On Unix, in an (unlikely) case that second fork() fails, we end up with one additional Zabbix process. Also, the code with sleep(3) looks kludgy and should be improved.



 Comments   
Comment by Rudolfs Kreicbergs [ 2011 Jun 03 ]

So there are 3 problems being fixed in this branch:

1) When using system_run[,wait], the scripts may not get terminated after the timeout - only the parent processes ("cmd" or "/bin/sh") are killed

2) system_run[,nowait] may have problems with forking (case when second fork() fails for UNIX and unclosed handles for WINDOWS)

3) UNIX code with "sleep(3);" - the problem is output redirection. In fact, sleep(3) does not work any more and the output is written to zabbix log files, all output should be suppressed.

Comment by Rudolfs Kreicbergs [ 2011 Jun 06 ]

Fixed in dev branch: svn://svn.zabbix.com/branches/dev/ZBX-3519

When syste_run[,wait] times out, all created processes are killed. Note: in UNIX this is attained by creating a new process group, which will not be in the zabbix process group.

Fixed the "sleep(3);" problem by redirect all output to /dev/null.

Comment by Rudolfs Kreicbergs [ 2011 Jun 13 ]

Fixed/available in pre-1.8.6 r20182 and pre-1.9.5 r20183.

Generated at Fri Apr 26 22:59:25 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.