fix: harden stack restart migration

This commit is contained in:
Eyejoker
2026-03-29 07:33:13 +09:00
parent ca578d1627
commit 3dd41f749e
6 changed files with 259 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ import os from 'os';
import path from 'path';
import { afterEach, describe, expect, it } from 'vitest';
import { buildStackRestartSystemdUnit } from './service.js';
import { getServiceDefs } from './service-defs.js';
/**
@@ -202,4 +203,18 @@ describe('service definitions', () => {
'ejclaw-review',
]);
});
it('generates a oneshot stack restart unit', () => {
const unit = buildStackRestartSystemdUnit(
'/srv/ejclaw',
'/usr/bin/node',
'/home/user',
);
expect(unit).toContain('Description=EJClaw Stack Restart Orchestrator');
expect(unit).toContain('Type=oneshot');
expect(unit).toContain(
'ExecStart=/bin/bash /srv/ejclaw/scripts/restart-ejclaw-stack.sh --direct',
);
});
});