 		restart()
 
 # This is a promise that resolves when we have fully initialised.
-exports.initialised = currentSupervisorConfig.then (currentSupervisor) ->
+exports.initialised = currentConfigPromise.then (currentSupervisor) ->
 	utils = require './utils'
 	JSONStream = require 'JSONStream'
 

localImage = config.localImage
remoteImage = config.remoteImage

getContainerId = ->
	fs.readFileAsync( '/proc/1/cgroup' )
	.then (data) ->
		data.toString().match( /:cpu:\/docker\/(.*)$/m )[1]
	.catch (err) ->
		return process.env.HOSTNAME

currentContainer = getContainerId().then (containerId) ->
		docker.getContainer(containerId)

startNewSupervisor = (currentSupervisor, waitForSuccess = true) ->

			console.log('And process.exiting..')
			process.exit()

currentConfigPromise = currentContainerPromise.then (container) ->
	container.inspectAsync()
.tap (currentSupervisor) ->
	# The volume keys are the important bit.
