Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

failed to run clear container standalone #158

Closed
devimc opened this issue May 22, 2017 · 4 comments
Closed

failed to run clear container standalone #158

devimc opened this issue May 22, 2017 · 4 comments
Assignees
Labels

Comments

@devimc
Copy link

devimc commented May 22, 2017

command

${RUNTIME} --debug --log runtime.log run --pid-file "${BUNDLE}/pid" --bundle "${BUNDLE}" --console $(tty) "${CONTNAME}"

current output:

fork/exec /home/X/gopath/src/github.com/clearcontainers/shim/cc-shim: operation not permitted

expected output:

sh-4.3#

the issue is that terminal is already the controlling terminal of a different session group, to allow spawned process use assigned terminal we have to steal it form the session group (TIOCSCTTY with arg=1)

@devimc devimc self-assigned this May 22, 2017
@devimc devimc added the bug label May 22, 2017
@devimc
Copy link
Author

devimc commented May 22, 2017

proposed fix devimc/go@559e40c

@devimc
Copy link
Author

devimc commented May 22, 2017

filed an issue in golang/go golang/go#20454

@dlespiau
Copy link
Contributor

Seems like the easier way to go about this is to not support --console $(tty). We could do what runc does when specifying /dev/ptmx as console path.

devimc pushed a commit to devimc/runtime that referenced this issue May 24, 2017
With this patch a new pts will be created when
the console provided as argument is /dev/ptmx.

Runtime stdout and stdin will be forwarded to
the master fd and then to the slave, something
like this:

/dev/pts/0 <--> master <--> /dev/pts/1

where pts 0 is assigned to the runtime and
pts 1 is assigned to the container

fixes clearcontainers#158

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/runtime that referenced this issue May 25, 2017
With this patch a new pts will be created when
the console provided as argument is /dev/ptmx.

Runtime stdout and stdin will be forwarded to
the master fd and then to the slave, something
like this:

```
/dev/pts/0 <--> master <--> /dev/pts/1
```

where pts 0 is assigned to the runtime and
pts 1 is assigned to the container

fixes clearcontainers#158

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/runtime that referenced this issue May 25, 2017
With this patch a new pts will be created when
the console provided as argument is /dev/ptmx.

Runtime stdout and stdin will be forwarded to
the master fd and then to the slave, something
like this:

```
/dev/pts/0 <--> master <--> /dev/pts/1
```

where pts 0 is assigned to the runtime and
pts 1 is assigned to the container

fixes clearcontainers#158

Signed-off-by: Julio Montes <[email protected]>
@devimc
Copy link
Author

devimc commented May 26, 2017

closing this issue because we can't support --console $(tty) since this is a limitation of golang (processes can't steal tty)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants