From 4a79b95efce039a109606a4e5c6f17d8e60ed683 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Sun, 21 Mar 2021 13:55:33 -0700 Subject: [PATCH] Tear down old containers properly --- backend/api.js | 2 +- system/src/riju-system-privileged.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/api.js b/backend/api.js index 86cdb0c..5afeaf2 100644 --- a/backend/api.js +++ b/backend/api.js @@ -442,7 +442,7 @@ export class Session { // block signals. Killing the foreground process (i.e. pid1) // should cause the Docker runtime to bring everything else // down in flames. - this.container.proc.kill(); + this.container.proc.stdin.end(); } allSessions.delete(this); this.ws.terminate(); diff --git a/system/src/riju-system-privileged.c b/system/src/riju-system-privileged.c index 44a0f6b..506d5bc 100644 --- a/system/src/riju-system-privileged.c +++ b/system/src/riju-system-privileged.c @@ -51,7 +51,7 @@ void session(char *uuid, char *lang) char *argv[] = { "docker", "run", - "--rm", + "--rm", "-i", "-e", "HOME=/home/riju", "-e", "HOSTNAME=riju", "-e", "LANG=C.UTF-8", @@ -66,7 +66,7 @@ void session(char *uuid, char *lang) "-e", "USERNAME=riju", "--hostname", "riju", "--name", container, - image, "tail", "-f", "/dev/null", NULL, + image, "cat", NULL, }; execvp(argv[0], argv); die("execvp failed");