Skip to content

Commit 3b377ed

Browse files
committed
refactor: use Deno build-in kill function
1 parent e82a91c commit 3b377ed

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scripts/docker/ceseal/gramine/handover.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,9 @@ async function killPreviousCeseal(version: number) {
8888
]);
8989

9090
if (code === 0) {
91-
const pid = new TextDecoder().decode(rawOutput);
92-
log(`the previous version ${version} ceseal pid: ${pid}`);
93-
const p = Deno.run({ cmd: ["bash", "-c", `kill -9 ${pid}`] });
94-
await p.status();
91+
const pid = parseInt(new TextDecoder().decode(rawOutput));
92+
log(`kill the previous version ${version} ceseal pid: ${pid}`);
93+
Deno.kill(pid, "SIGKILL");
9594
} else {
9695
const errorString = new TextDecoder().decode(rawError);
9796
log(errorString);

0 commit comments

Comments
 (0)