aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/app/app.go')
-rw-r--r--internal/app/app.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/internal/app/app.go b/internal/app/app.go
index 0adc1210..175c315a 100644
--- a/internal/app/app.go
+++ b/internal/app/app.go
@@ -1,6 +1,7 @@
package app
import (
+ "context"
"sync"
"sync/atomic"
@@ -12,17 +13,22 @@ import (
type App interface {
// ID returns a copy of App's unique ID.
ID() fst.ID
- // Start sets up the system and starts the App.
- Start() error
- // Wait waits for App's process to exit and reverts system setup.
- Wait() (int, error)
- // WaitErr returns error returned by the underlying wait syscall.
- WaitErr() error
+ // Run sets up the system and runs the App.
+ Run(ctx context.Context, rs *RunState) error
Seal(config *fst.Config) error
String() string
}
+type RunState struct {
+ // Start is true if fsu is successfully started.
+ Start bool
+ // ExitCode is the value returned by fshim.
+ ExitCode int
+ // WaitErr is error returned by the underlying wait syscall.
+ WaitErr error
+}
+
type app struct {
// single-use config reference
ct *appCt
@@ -35,8 +41,6 @@ type app struct {
shim *shim.Shim
// child process related information
seal *appSeal
- // error returned waiting for process
- waitErr error
lock sync.RWMutex
}
@@ -64,10 +68,6 @@ func (a *app) String() string {
return "(unsealed fortified app)"
}
-func (a *app) WaitErr() error {
- return a.waitErr
-}
-
func New(os linux.System) (App, error) {
a := new(app)
a.id = new(fst.ID)