Skip to content

Commit 09a6216

Browse files
maria-rcksnateEc
andcommitted
fix(server): avoid uresourced loops in Linux service units
Co-authored-by: Yukun Shan <[email protected]>
1 parent 3d78e91 commit 09a6216

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎apps/server/src/cloud/bootService.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,12 @@ it.layer(NodeServices.layer)("boot service install", (it) => {
389389
activeVersion: "1.2.3",
390390
});
391391
expect(plan.program).toEqual([runtime.entryPath, "__service-launcher"]);
392-
expect(yield* fs.readFileString(plan.unitPath)).toContain(
393-
`ExecStart=${runtime.entryPath} __service-launcher`,
394-
);
392+
const unit = yield* fs.readFileString(plan.unitPath);
393+
expect(unit).toContain(`ExecStart=${runtime.entryPath} __service-launcher`);
394+
expect(unit).toContain("OOMPolicy=continue");
395+
expect(unit).toContain("CPUWeight=1000");
396+
expect(unit).toContain("IOWeight=1000");
397+
expect(unit).not.toContain("ManagedOOMPreference=");
395398
expect(yield* service.status).toMatchObject({
396399
current: true,
397400
installedVersion: "1.2.3",

‎apps/server/src/cloud/bootService.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ export function renderBootServiceUnit(plan: BootServicePlan): string {
121121
// A user manager's own score, the lowest it may set: below its other services (200) and agents (800).
122122
// `t3 service protect` lowers it further through a drop-in.
123123
"OOMScoreAdjust=100",
124-
// systemd-oomd ignores this preference when the watched cgroup is root-owned, as user-1000.slice usually is.
125-
"ManagedOOMPreference=avoid",
126124
`StandardOutput=append:${escapeSystemdSpecifiers(plan.logPath)}`,
127125
`StandardError=append:${escapeSystemdSpecifiers(plan.logPath)}`,
128126
"",

0 commit comments

Comments
 (0)