@geekbeer/minion 2.68.0 → 2.68.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -213,8 +213,8 @@ function buildAllowedCommands(procMgr, agentConfig = {}) {
|
|
|
213
213
|
const pidFile = path.join(dataDir, 'minion-agent.pid')
|
|
214
214
|
const startScript = path.join(dataDir, 'start-agent.ps1')
|
|
215
215
|
|
|
216
|
-
const stopBlock = `$
|
|
217
|
-
const startBlock = `Start-Process powershell -ArgumentList '-ExecutionPolicy Bypass -WindowStyle Hidden -File
|
|
216
|
+
const stopBlock = `$agentPid = Get-Content '${pidFile}' -ErrorAction SilentlyContinue; if ($agentPid) { Get-CimInstance Win32_Process -Filter ('ParentProcessId = ' + $agentPid) -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }; Stop-Process -Id $agentPid -Force -ErrorAction SilentlyContinue }`
|
|
217
|
+
const startBlock = `Start-Process powershell -ArgumentList ('-ExecutionPolicy Bypass -WindowStyle Hidden -File \"' + '${startScript}' + '\"') -WindowStyle Hidden`
|
|
218
218
|
|
|
219
219
|
commands['restart-agent'] = {
|
|
220
220
|
description: 'Restart the minion agent process',
|
|
@@ -248,7 +248,7 @@ function buildAllowedCommands(procMgr, agentConfig = {}) {
|
|
|
248
248
|
}
|
|
249
249
|
commands['status-services'] = {
|
|
250
250
|
description: 'Show agent process info',
|
|
251
|
-
command: `powershell -Command "$pidFile = '${pidFile}'; if (Test-Path $pidFile) { $
|
|
251
|
+
command: `powershell -Command "$pidFile = '${pidFile}'; if (Test-Path $pidFile) { $agentPid = (Get-Content $pidFile -Raw).Trim(); $proc = Get-Process -Id $agentPid -ErrorAction SilentlyContinue; if ($proc) { Write-Host 'minion-agent: running (PID:' $agentPid ')' } else { Write-Host 'minion-agent: not running (stale PID)' } } else { Write-Host 'minion-agent: not running' }"`,
|
|
252
252
|
}
|
|
253
253
|
} else if (procMgr === 'nssm') {
|
|
254
254
|
// NSSM handles graceful stop via its own service control, so no HTTP API needed
|