summaryrefslogtreecommitdiffhomepage
path: root/runsc/main.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-06-28 09:45:52 -0700
committerShentubot <shentubot@google.com>2018-06-28 09:46:50 -0700
commit1f207de315430fb178b7025a5afd419afdc31449 (patch)
tree71acf7018db907918a4d9bdf1a32f203a52f408d /runsc/main.go
parent6b6852bceb12900f27a541682ddfe47893911c6e (diff)
Add option to configure watchdog action
PiperOrigin-RevId: 202494747 Change-Id: I4d4a18e71468690b785060e580a5f83c616bd90f
Diffstat (limited to 'runsc/main.go')
-rw-r--r--runsc/main.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/runsc/main.go b/runsc/main.go
index aa5796d42..563ef8c67 100644
--- a/runsc/main.go
+++ b/runsc/main.go
@@ -60,6 +60,7 @@ var (
fileAccess = flag.String("file-access", "proxy", "specifies which filesystem to use: proxy (default), direct. Using a proxy is more secure because it disallows the sandbox from opennig files directly in the host.")
overlay = flag.Bool("overlay", false, "wrap filesystem mounts with writable overlay. All modifications are stored in memory inside the sandbox.")
multiContainer = flag.Bool("multi-container", false, "enable *experimental* multi-container support.")
+ watchdogAction = flag.String("watchdog-action", "log", "sets what action the watchdog takes when triggered: log (default), panic.")
)
var gitRevision = ""
@@ -110,6 +111,11 @@ func main() {
cmd.Fatalf("%v", err)
}
+ wa, err := boot.MakeWatchdogAction(*watchdogAction)
+ if err != nil {
+ cmd.Fatalf("%v", err)
+ }
+
// Create a new Config from the flags.
conf := &boot.Config{
RootDir: *rootDir,
@@ -125,6 +131,7 @@ func main() {
Strace: *strace,
StraceLogSize: *straceLogSize,
MultiContainer: *multiContainer,
+ WatchdogAction: wa,
}
if len(*straceSyscalls) != 0 {
conf.StraceSyscalls = strings.Split(*straceSyscalls, ",")