openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 1.28 kB
JavaScript
import{s as LEGACY_GATEWAY_SYSTEMD_SERVICE_NAMES}from"./constants-tH5Q8GoI.mjs";import{a as uninstallLegacySystemdUnits}from"./systemd-lifecycle-CKiXKu66.mjs";import"./systemd-BLmKdJhz.mjs";
//!src/commands/doctor-gateway-legacy-services.ts
function classifyLegacyServices(e){const t=[];const n=[];const r=[];for(const i of e){const e=i.platform===`darwin`?t:i.platform===`linux`?n:void 0;if(e&&i.scope===`user`){if(i.platform===`linux`&&!LEGACY_GATEWAY_SYSTEMD_SERVICE_NAMES.some(e=>i.label===`${e}.service`))r.push(`${i.label} (legacy unit name not recognized)`);else e.push(i)}else r.push(`${i.label} (${e?i.scope:i.platform})`)}return{darwinUserServices:t,linuxUserServices:n,failed:r}}async function cleanupLegacyLinuxUserServices(e,t){const n=[];const r=[];try{const t=await uninstallLegacySystemdUnits({env:process.env,stdout:process.stdout});const i=new Map(t.map(e=>[`${e.name}.service`,e]));for(const t of e){const e=i.get(t.label);if(!e){r.push(`${t.label} (legacy unit name not recognized)`);continue}n.push(`${t.label} -> ${e.unitPath}`)}}catch(n){t.error(`Legacy Linux gateway cleanup failed: ${String(n)}`);for(const t of e)r.push(`${t.label} (linux cleanup failed)`)}return{removed:n,failed:r}}export{cleanupLegacyLinuxUserServices as n,classifyLegacyServices as t};