Skip to content

Fix issues with posix-based kills on Windows #5806

@MSS970

Description

@MSS970

Cacti version: 1.3 [Dev]
OS: Windows 2019

ERROR PHP ERROR: Uncaught Error: Undefined constant "SIGTERM" in D:\cacti\apache\htdocs\cacti\lib\poller.php:2401 Stack trace: #0 D:\cacti\apache\htdocs\cacti\plugins\thold\poller_thold.php(94): register_process_start() #1 {main} thrown in file: D:\cacti\apache\htdocs\cacti\lib\poller.php on line: 2401

/lib/poller.php line: 2401 is not supported in Windows
posix_kill($r['pid'], SIGTERM);

To resolve this bug:
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
posix_kill($r['pid'], SIGTERM);
} else {
exec("taskkill /PID " . $r['pid'] . " /F");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourconfirmedBug is confirm by dev teamresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions