runtime: unify final delivery and startup preconditions
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import path from 'path';
|
||||
|
||||
import { STARTUP_PRECONDITION_EXIT_CODE } from '../src/startup-preconditions.js';
|
||||
import type { ServiceDef } from './service-defs.js';
|
||||
|
||||
export function buildRuntimePathEnv(nodePath: string, homeDir: string): string {
|
||||
@@ -111,6 +112,7 @@ ExecStart=${nodePath} ${projectRoot}/dist/index.js
|
||||
WorkingDirectory=${projectRoot}
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
RestartPreventExitStatus=${STARTUP_PRECONDITION_EXIT_CODE}
|
||||
${envLines.join('\n')}
|
||||
StandardOutput=append:${projectRoot}/logs/${def.logName}.log
|
||||
StandardError=append:${projectRoot}/logs/${def.logName}.error.log
|
||||
|
||||
@@ -108,6 +108,7 @@ describe('systemd unit generation', () => {
|
||||
);
|
||||
expect(unit).toContain('Restart=always');
|
||||
expect(unit).toContain('RestartSec=5');
|
||||
expect(unit).toContain('RestartPreventExitStatus=78');
|
||||
});
|
||||
|
||||
it('sets correct ExecStart', () => {
|
||||
|
||||
Reference in New Issue
Block a user