Skip to content

Commit

Permalink
refactor: use Deno build-in kill function
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbillw committed Feb 21, 2024
1 parent e82a91c commit 3b377ed
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/docker/ceseal/gramine/handover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ async function killPreviousCeseal(version: number) {
]);

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

0 comments on commit 3b377ed

Please sign in to comment.