mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-12 16:02:57 +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'
|
JSONStream = require 'JSONStream'
|
||||||
PlatformAPI = require 'resin-platform-api/request'
|
PlatformAPI = require 'resin-platform-api/request'
|
||||||
utils = require './utils'
|
utils = require './utils'
|
||||||
|
tty = require './tty'
|
||||||
|
|
||||||
PLATFORM_ENDPOINT = url.resolve(config.apiEndpoint, '/ewa/')
|
PLATFORM_ENDPOINT = url.resolve(config.apiEndpoint, '/ewa/')
|
||||||
resinAPI = new PlatformAPI(PLATFORM_ENDPOINT)
|
resinAPI = new PlatformAPI(PLATFORM_ENDPOINT)
|
||||||
@ -44,6 +45,9 @@ exports.kill = kill = (app) ->
|
|||||||
updateDeviceInfo(status: 'Stopping')
|
updateDeviceInfo(status: 'Stopping')
|
||||||
container = docker.getContainer(app.containerId)
|
container = docker.getContainer(app.containerId)
|
||||||
console.log('Stopping and deleting container:', container)
|
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()
|
container.stopAsync()
|
||||||
.then ->
|
.then ->
|
||||||
container.removeAsync()
|
container.removeAsync()
|
||||||
|
Loading…
Reference in New Issue
Block a user