diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-10-08 11:08:14 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@gmail.com> | 2018-10-11 13:19:39 -0400 |
commit | f87f0abb77f27a868d03656cf0458e2f0a88ca5f (patch) | |
tree | 2b2becf04c26213361eeeed5a8e0e997642170ee /pkg | |
parent | b5f4bb15a5569ba6cf3517c3c979c75ad205ada5 (diff) | |
download | podman-f87f0abb77f27a868d03656cf0458e2f0a88ca5f.tar.gz podman-f87f0abb77f27a868d03656cf0458e2f0a88ca5f.tar.bz2 podman-f87f0abb77f27a868d03656cf0458e2f0a88ca5f.zip |
Pass along syslog variable to podman cleanup processes
As of now, there is no way to debug podman clean up processes.
They are started by conmon with no stdout/stderr and log nowhere.
This allows us to actually figure out what is going on when a
cleanup process runs.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/spec/createconfig.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go index 887ef8e95..9e8f6253b 100644 --- a/pkg/spec/createconfig.go +++ b/pkg/spec/createconfig.go @@ -133,6 +133,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 } @@ -287,8 +288,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, @@ -301,6 +302,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"}...) } @@ -474,7 +478,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 |