mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-03-11 06:54:17 +00:00
Use sudo to build the correct running enviroment for the app
This commit is contained in:
parent
6df6feb5ef
commit
b8099372dd
@ -15,9 +15,11 @@ class Application extends EventEmitter
|
|||||||
cwd: @path
|
cwd: @path
|
||||||
stdio: 'inherit'
|
stdio: 'inherit'
|
||||||
uid: getpwnam(@user).uid
|
uid: getpwnam(@user).uid
|
||||||
|
gid: getpwnam(@user).gid
|
||||||
env:
|
env:
|
||||||
USER: @user
|
USER: @user
|
||||||
USERNAME: @user
|
USERNAME: @user
|
||||||
|
HOME: "/home/#{@user}"
|
||||||
|
|
||||||
_init: (callback) ->
|
_init: (callback) ->
|
||||||
tasks = [
|
tasks = [
|
||||||
@ -45,7 +47,11 @@ class Application extends EventEmitter
|
|||||||
|
|
||||||
_start: (callback) ->
|
_start: (callback) ->
|
||||||
if not @process
|
if not @process
|
||||||
@process = spawn('foreman', ['start'], @options)
|
options =
|
||||||
|
cwd: @path
|
||||||
|
stdio: 'inherit'
|
||||||
|
|
||||||
|
@process = spawn('sudo', ['-u', @user, 'foreman', 'start'], options)
|
||||||
@emit('start')
|
@emit('start')
|
||||||
callback?()
|
callback?()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user