 	application.poll()
 
 specialActionEnvVars =
-	'RESIN_OVERRIDE_LOCK': null
-	'RESIN_VPN_CONTROL': utils.vpnControl
-	'RESIN_CONNECTIVITY_CHECK': utils.connectivityCheck
-	'RESIN_POLL_INTERVAL': apiPollInterval
-	'RESIN_LOG_CONTROL': utils.resinLogControl
+	'RESIN_SUPERVISOR_UPDATE_STRATEGY': null
+	'RESIN_SUPERVISOR_HANDOVER_TIMEOUT': null
+	'RESIN_SUPERVISOR_OVERRIDE_LOCK': null
+	'RESIN_SUPERVISOR_VPN_CONTROL': utils.vpnControl
+	'RESIN_SUPERVISOR_CONNECTIVITY_CHECK': utils.connectivityCheck
+	'RESIN_SUPERVISOR_POLL_INTERVAL': apiPollInterval
+	'RESIN_SUPERVISOR_LOG_CONTROL': utils.resinLogControl
 
 executedSpecialActionEnvVars = {}
 

							app = remoteApps[appId]
							# Restore the complete environment so that it's persisted in the DB
							app.env = JSON.stringify(remoteAppEnvs[appId])
							start(app)
						else if _.includes(toBeUpdated, appId)
							localApp = apps[appId]
							app = remoteApps[appId]
							# Restore the complete environment so that it's persisted in the DB
							app.env = JSON.stringify(remoteAppEnvs[appId])
							logSystemEvent(logTypes.updateApp, app) if localApp.imageId == app.imageId
							forceThisApp = remoteAppEnvs[appId]['RESIN_OVERRIDE_LOCK'] == '1'
							Promise.using lockUpdates(localApp, force || forceThisApp), ->
								knex('app').select().where({ appId })
								.then ([ localApp ]) ->
									if !localApp?
										throw new Error('App not found')
									kill(localApp)
								.then ->
									start(app)
							.catch (err) ->
								logSystemEvent(logTypes.updateAppError, app, err)
								throw err
					.catch(wrapAsError)
		.filter(_.isError)
		.then (failures) ->

	return err if _.isError(err)
	return new Error(err.message ? err)

selectAndKill = (appId) ->
	knex('app').select().where({ appId })
	.then ([ app ]) ->
		if !app?
			throw new Error('App not found')
		kill(app)

waitToKill = (app, timeout) ->
	# TO-DO
	# Wait for app to signal it's ready to die, or timeout to complete (if it is defined and not-empty)

UPDATE_IDLE = 0
UPDATE_UPDATING = 1
UPDATE_REQUIRED = 2
