This commit is contained in:
Radon Rosborough 2021-06-19 08:09:22 +00:00
parent 9256f228e6
commit fcf5432058
2 changed files with 6 additions and 3 deletions

View File

@ -300,7 +300,11 @@ export class Session {
template,
} = this.config;
if (this.term) {
process.kill(this.term.pty.pid);
try {
process.kill(this.term.pty.pid);
} catch (err) {
// process might have already exited
}
// Signal to terminalOutput message generator using closure.
this.term.live = false;
this.term = null;

View File

@ -30,7 +30,6 @@ args = parser.parse_args()
pidfiles = "/var/run/riju/pidfiles"
pidfile = pidfiles + "/" + str(uuid.uuid4()).replace("-", "")
print(pidfile)
# We have to use 'kill -9' here, otherwise runuser intercepts the
# signal and takes its sweet time cleaning up.
@ -44,7 +43,7 @@ def cleanup(*ignored_args):
f"""
set -euo pipefail
if [[ -f '{pidfile}' ]]; then
kill -9 -$(< '{pidfile}')
kill -9 -$(< '{pidfile}') 2>/dev/null || true
rm -f '{pidfile}'
fi
"""