mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-25 00:11:06 +00:00
Make sure to stop any spawned tty sessions on container stop.
This commit is contained in:
parent
ad107b30ae
commit
c1b1aba985
@ -10,6 +10,7 @@ Promise = require 'bluebird'
|
||||
JSONStream = require 'JSONStream'
|
||||
PlatformAPI = require 'resin-platform-api/request'
|
||||
utils = require './utils'
|
||||
tty = require './tty'
|
||||
|
||||
PLATFORM_ENDPOINT = url.resolve(config.apiEndpoint, '/ewa/')
|
||||
resinAPI = new PlatformAPI(PLATFORM_ENDPOINT)
|
||||
@ -44,6 +45,9 @@ exports.kill = kill = (app) ->
|
||||
updateDeviceInfo(status: 'Stopping')
|
||||
container = docker.getContainer(app.containerId)
|
||||
console.log('Stopping and deleting container:', container)
|
||||
tty.stop()
|
||||
.catch(->) # Even if stopping the tty fails we want to finish stopping the container
|
||||
.then ->
|
||||
container.stopAsync()
|
||||
.then ->
|
||||
container.removeAsync()
|
||||
|
Loading…
Reference in New Issue
Block a user