[ZBX-6140] system.run checks are no longer supported in agent on Windows 2000 Created: 2013 Jan 16  Updated: 2017 May 30  Resolved: 2013 Jan 18

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 1.8.14, 2.0.4
Fix Version/s: 2.0.5rc1, 2.1.0

Type: Incident report Priority: Major
Reporter: Brendan Gilmore Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: agent, regression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 2000



 Description   

When a check uses system.run, the agent logs an error:
unable to set job info: [0x00000057] The parameter is incorrect.

Found that error text on line 305 of /src/libs/zbxexec/execute.c

Seems to be a problem with the parameters of SetInformationJobObject.
Looks like the bug originated when this Job Object code was added in ZBX-3519



 Comments   
Comment by Andris Zeila [ 2013 Jan 18 ]

The JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag used to close all associated processes when the job terminates is not supported in Windows 2000.

Probably the best we can do is to remove 'subprocess' closing support for win2k.

Comment by Brendan Gilmore [ 2013 Jan 18 ]

I'll preface this by saying this subject is a bit beyond my capabilities, but I did find reference to TerminateJobObject(HANDLE hJob, UINT uExitCode) on http://www.microsoft.com/msj/0399/jobkernelobj/jobkernelobj.aspx
Since it appears the zabbix code (execute.c line 376) includes this call, I think the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag would be safe to omit under win2k, but the functionality of closing associated processes would remain.

Comment by Andris Zeila [ 2013 Jan 18 ]

Yes, thats right. Actually in this case setting JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE
is not really needed. So the only thing that remains is setting JOB_OBJECT_LIMIT_BREAKAWAY_OK
flag (which is preventing child processes to explicitly disassociate themselves from the job),
though I'm not sure it's event set by default - need to verify.

Comment by Andris Zeila [ 2013 Jan 18 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-6140$

Comment by Brendan Gilmore [ 2013 Jan 31 ]

I've compiled the Windows agent and tested it on a Windows 2000 system. I've confirmed this resolves the reported issue. Am I allowed to mark the issue as tested so it can be merged upstream?

Comment by richlv [ 2013 Jan 31 ]

no, there is also supposed to be a full code review

Comment by Alexander Vladishev [ 2013 Feb 04 ]

Successfully tested!

Comment by Andris Zeila [ 2013 Feb 04 ]

Fixed in:
pre-2.0.5rc1 r33379
pre-2.1.0 r33380

Generated at Sat Apr 20 18:52:59 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.