summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/create.go1
-rw-r--r--pkg/spec/createconfig.go10
2 files changed, 8 insertions, 3 deletions
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index 0e12f5a8c..248ff1b7d 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -782,6 +782,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
WorkDir: workDir,
Rootfs: rootfs,
VolumesFrom: c.StringSlice("volumes-from"),
+ Syslog: c.GlobalBool("syslog"),
}
if config.Privileged {
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go
index e9a5dc9dc..d34b21189 100644
--- a/pkg/spec/createconfig.go
+++ b/pkg/spec/createconfig.go
@@ -134,6 +134,7 @@ type CreateConfig struct {
SecurityOpts []string
Rootfs string
LocalVolumes []string //Keeps track of the built-in volumes of container used in the --volumes-from flag
+ Syslog bool // Whether to enable syslog on exit commands
}
func u32Ptr(i int64) *uint32 { u := uint32(i); return &u }
@@ -288,8 +289,8 @@ func (c *CreateConfig) GetTmpfsMounts() []spec.Mount {
return m
}
-func createExitCommand(runtime *libpod.Runtime) []string {
- config := runtime.GetConfig()
+func (c *CreateConfig) createExitCommand() []string {
+ config := c.Runtime.GetConfig()
cmd, _ := os.Executable()
command := []string{cmd,
@@ -302,6 +303,9 @@ func createExitCommand(runtime *libpod.Runtime) []string {
if config.StorageConfig.GraphDriverName != "" {
command = append(command, []string{"--storage-driver", config.StorageConfig.GraphDriverName}...)
}
+ if c.Syslog {
+ command = append(command, "--syslog")
+ }
return append(command, []string{"container", "cleanup"}...)
}
@@ -481,7 +485,7 @@ func (c *CreateConfig) GetContainerCreateOptions(runtime *libpod.Runtime) ([]lib
options = append(options, libpod.WithCgroupParent(c.CgroupParent))
}
if c.Detach {
- options = append(options, libpod.WithExitCommand(createExitCommand(runtime)))
+ options = append(options, libpod.WithExitCommand(c.createExitCommand()))
}
return options, nil