mirror of
https://github.com/containers/podman.git
synced 2025-06-25 12:20:42 +08:00
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>
This commit is contained in:
@ -782,6 +782,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
|
|||||||
WorkDir: workDir,
|
WorkDir: workDir,
|
||||||
Rootfs: rootfs,
|
Rootfs: rootfs,
|
||||||
VolumesFrom: c.StringSlice("volumes-from"),
|
VolumesFrom: c.StringSlice("volumes-from"),
|
||||||
|
Syslog: c.GlobalBool("syslog"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.Privileged {
|
if config.Privileged {
|
||||||
|
@ -133,6 +133,7 @@ type CreateConfig struct {
|
|||||||
SecurityOpts []string
|
SecurityOpts []string
|
||||||
Rootfs string
|
Rootfs string
|
||||||
LocalVolumes []string //Keeps track of the built-in volumes of container used in the --volumes-from flag
|
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 }
|
func u32Ptr(i int64) *uint32 { u := uint32(i); return &u }
|
||||||
@ -287,8 +288,8 @@ func (c *CreateConfig) GetTmpfsMounts() []spec.Mount {
|
|||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
|
||||||
func createExitCommand(runtime *libpod.Runtime) []string {
|
func (c *CreateConfig) createExitCommand() []string {
|
||||||
config := runtime.GetConfig()
|
config := c.Runtime.GetConfig()
|
||||||
|
|
||||||
cmd, _ := os.Executable()
|
cmd, _ := os.Executable()
|
||||||
command := []string{cmd,
|
command := []string{cmd,
|
||||||
@ -301,6 +302,9 @@ func createExitCommand(runtime *libpod.Runtime) []string {
|
|||||||
if config.StorageConfig.GraphDriverName != "" {
|
if config.StorageConfig.GraphDriverName != "" {
|
||||||
command = append(command, []string{"--storage-driver", 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"}...)
|
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))
|
options = append(options, libpod.WithCgroupParent(c.CgroupParent))
|
||||||
}
|
}
|
||||||
if c.Detach {
|
if c.Detach {
|
||||||
options = append(options, libpod.WithExitCommand(createExitCommand(runtime)))
|
options = append(options, libpod.WithExitCommand(c.createExitCommand()))
|
||||||
}
|
}
|
||||||
|
|
||||||
return options, nil
|
return options, nil
|
||||||
|
Reference in New Issue
Block a user