mirror of
https://github.com/containers/podman.git
synced 2025-10-18 19:53:58 +08:00
Change location of created runc specs to make them survive reboot
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #78 Approved by: rhatdan
This commit is contained in:
@ -280,7 +280,7 @@ func (c *Container) MountPoint() (string, error) {
|
|||||||
// The path to the container's root filesystem - where the OCI spec will be
|
// The path to the container's root filesystem - where the OCI spec will be
|
||||||
// placed, amongst other things
|
// placed, amongst other things
|
||||||
func (c *Container) bundlePath() string {
|
func (c *Container) bundlePath() string {
|
||||||
return c.state.RunDir
|
return c.config.StaticDir
|
||||||
}
|
}
|
||||||
|
|
||||||
// The path to the container's logs file
|
// The path to the container's logs file
|
||||||
|
@ -53,7 +53,7 @@ func (c *Container) attachContainerSocket(resize <-chan remotecommand.TerminalSi
|
|||||||
term.SetRawTerminal(inputStream.Fd())
|
term.SetRawTerminal(inputStream.Fd())
|
||||||
}
|
}
|
||||||
|
|
||||||
controlPath := filepath.Join(c.state.RunDir, "ctl")
|
controlPath := filepath.Join(c.bundlePath(), "ctl")
|
||||||
controlFile, err := os.OpenFile(controlPath, unix.O_WRONLY, 0)
|
controlFile, err := os.OpenFile(controlPath, unix.O_WRONLY, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "failed to open container ctl file: %v")
|
return errors.Wrapf(err, "failed to open container ctl file: %v")
|
||||||
|
@ -169,8 +169,6 @@ func (r *OCIRuntime) createContainer(ctr *Container, cgroupParent string) (err e
|
|||||||
args = append(args, "-r", r.path)
|
args = append(args, "-r", r.path)
|
||||||
args = append(args, "-b", ctr.bundlePath())
|
args = append(args, "-b", ctr.bundlePath())
|
||||||
args = append(args, "-p", filepath.Join(ctr.state.RunDir, "pidfile"))
|
args = append(args, "-p", filepath.Join(ctr.state.RunDir, "pidfile"))
|
||||||
// TODO container log location should be configurable
|
|
||||||
// The default also likely shouldn't be this
|
|
||||||
args = append(args, "-l", ctr.logPath())
|
args = append(args, "-l", ctr.logPath())
|
||||||
args = append(args, "--exit-dir", r.exitsDir)
|
args = append(args, "--exit-dir", r.exitsDir)
|
||||||
args = append(args, "--socket-dir-path", r.socketsDir)
|
args = append(args, "--socket-dir-path", r.socketsDir)
|
||||||
@ -190,7 +188,7 @@ func (r *OCIRuntime) createContainer(ctr *Container, cgroupParent string) (err e
|
|||||||
}).Debugf("running conmon: %s", r.conmonPath)
|
}).Debugf("running conmon: %s", r.conmonPath)
|
||||||
|
|
||||||
cmd := exec.Command(r.conmonPath, args...)
|
cmd := exec.Command(r.conmonPath, args...)
|
||||||
cmd.Dir = ctr.state.RunDir
|
cmd.Dir = ctr.bundlePath()
|
||||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||||
Setpgid: true,
|
Setpgid: true,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user