aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-11-27 12:03:43 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-29 18:43:56 +0000
commit13e833a3884a22ac303b6f97a59cbeef16950243 (patch)
treedfaf8d95d6e9f52a0018e7b1bcc7c0360a706d03 /libpod
parentd55cb0f58981d52ed970156acd5f499659962b32 (diff)
downloadpodman-13e833a3884a22ac303b6f97a59cbeef16950243.tar.gz
podman-13e833a3884a22ac303b6f97a59cbeef16950243.tar.bz2
podman-13e833a3884a22ac303b6f97a59cbeef16950243.zip
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
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container.go2
-rw-r--r--libpod/container_attach.go2
-rw-r--r--libpod/oci.go4
3 files changed, 3 insertions, 5 deletions
diff --git a/libpod/container.go b/libpod/container.go
index 913d989ca..aa80fb4a5 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -280,7 +280,7 @@ func (c *Container) MountPoint() (string, error) {
// The path to the container's root filesystem - where the OCI spec will be
// placed, amongst other things
func (c *Container) bundlePath() string {
- return c.state.RunDir
+ return c.config.StaticDir
}
// The path to the container's logs file
diff --git a/libpod/container_attach.go b/libpod/container_attach.go
index 8c1c98fe5..7775e1a5d 100644
--- a/libpod/container_attach.go
+++ b/libpod/container_attach.go
@@ -53,7 +53,7 @@ func (c *Container) attachContainerSocket(resize <-chan remotecommand.TerminalSi
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)
if err != nil {
return errors.Wrapf(err, "failed to open container ctl file: %v")
diff --git a/libpod/oci.go b/libpod/oci.go
index 750e94fe7..4abbc5122 100644
--- a/libpod/oci.go
+++ b/libpod/oci.go
@@ -169,8 +169,6 @@ func (r *OCIRuntime) createContainer(ctr *Container, cgroupParent string) (err e
args = append(args, "-r", r.path)
args = append(args, "-b", ctr.bundlePath())
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, "--exit-dir", r.exitsDir)
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)
cmd := exec.Command(r.conmonPath, args...)
- cmd.Dir = ctr.state.RunDir
+ cmd.Dir = ctr.bundlePath()
cmd.SysProcAttr = &syscall.SysProcAttr{
Setpgid: true,
}