T06 · System Persistence
- Location
lifecycle.js:309- Finding
Persistent watchdog survives normal stop operations
- Content
View full analysis
j.name === 'evolver_watchdog_robust'); if (!exists) { console.log('[Lifecycle] Creating missing cron job: evolver_watchdog_robust...'); const cmdStr = `${openclawCli} cron add --name "evolver_watchdog_robust" --every "30m" --session "isolated" --message "exec: node skills/feishu-evolver-wrapper/lifecycle.js ensure" --no-deliver`; execSync(cmdStr, { windowsHide: true }); console.log('[Lifecycle] Watchdog cron job created successfully.'); } else { if (exists.enabled === false) { console.log(`[Lifecycle] Enabling disabled watchdog job (ID: ${exists.id})...`); execSync(`${openclawCli} cron edit "${exists.id}" --enable`, { windowsHide: true }); } if (exists.schedule && exists.schedule.everyMs === 600000) { console.log(`[Lifecycle] Optimizing watchdog frequency to 30m (ID: ${exists.id})...`); execSync(`${openclawCli} cron edit "${exists.id}" --every "30m"`, { windowsHide: true }); } } ``` ```js function start(args) { const pid = getRunningPid(); if (pid) { console.log(`Evolver wrapper is already running (PID ${pid}).`); return; } ensureWatchdog(); console.log('Starting Evolver Wrapper...'); const out = fs.openSync(path.resolve(__dirname, '../../logs/wrapper_out.log'), 'a'); const err = fs.openSync(path.resolve(__dirname, '../../logs/wrapper_err.log'), 'a'); const child = spawn('node', [WRAPPER_INDEX, ...args], { detached: !IS_WIN, stdio: ['ignore', out, err], cwd: __dirname, windowsHide: true }); fs.writeFileSync(PID_FILE, String(child.pid)); child.unref(); console.log(`Started background process (PID ${child.pid}).`); } ``` ```js function stop() { const pid = getRunningPid(); ...[truncated 2558 chars]- Remediation
View remediation
