mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-20 17:52:51 +00:00
Make the data path configurable
This commit is contained in:
parent
d88e7d7d36
commit
164d565283
@ -1,3 +1,5 @@
|
||||
* Make the data path configurable [Pablo]
|
||||
|
||||
# v1.11.3
|
||||
|
||||
* Add listener for container events and reattach on restart [Pablo]
|
||||
|
@ -67,6 +67,9 @@ func main() {
|
||||
// Start OOMProtectionTimer for protecting Openvpn/Connman
|
||||
dockerSocket := os.Getenv("DOCKER_SOCKET")
|
||||
hostproc := os.Getenv("HOST_PROC")
|
||||
if dataPathEnv := os.Getenv("RESIN_DATA_PATH"); dataPathEnv != "" {
|
||||
ResinDataPath = "/mnt/root" + dataPathEnv
|
||||
}
|
||||
defer startOOMProtectionTimer(hostproc, dockerSocket).Stop()
|
||||
|
||||
listenAddress := os.Getenv("GOSUPER_SOCKET")
|
||||
|
@ -174,7 +174,7 @@ application.start = start = (app) ->
|
||||
'/host/var/lib/connman': {}
|
||||
'/host/run/dbus': {}
|
||||
binds = [
|
||||
'/resin-data/' + app.appId + ':/data'
|
||||
config.dataPath + '/' + app.appId + ':/data'
|
||||
'/lib/modules:/lib/modules'
|
||||
'/lib/firmware:/lib/firmware'
|
||||
'/run/dbus:/run/dbus'
|
||||
@ -305,11 +305,11 @@ getEnvironment = do ->
|
||||
|
||||
lockPath = (app) ->
|
||||
appId = app.appId ? app
|
||||
return "/mnt/root/resin-data/#{appId}/resin-updates.lock"
|
||||
return "/mnt/root#{config.dataPath}/#{appId}/resin-updates.lock"
|
||||
|
||||
killmePath = (app) ->
|
||||
appId = app.appId ? app
|
||||
return "/mnt/root/resin-data/#{appId}/resin-kill-me"
|
||||
return "/mnt/root#{config.dataPath}/#{appId}/resin-kill-me"
|
||||
|
||||
# At boot, all apps should be unlocked *before* start to prevent a deadlock
|
||||
application.unlockAndStart = unlockAndStart = (app) ->
|
||||
|
@ -48,3 +48,4 @@ module.exports = config =
|
||||
'RESIN_SUPERVISOR_API_KEY'
|
||||
'RESIN_API_KEY'
|
||||
]
|
||||
dataPath: checkString(process.env.RESIN_DATA_PATH) ? "/resin-data"
|
||||
|
Loading…
x
Reference in New Issue
Block a user