Commit Graph

11 Commits

Author SHA1 Message Date
Gao feng 5c3bd1b19f initialize ptyfd and eventfd for exec
initialize them to -1

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-09-24 11:02:45 +08:00
Gao feng a8362c1a70 hold the fd of container pts device in hyper init
1, Hold the the file description of pts device and ptmx in hyper-init process
2, Dup fd to the stdio of Exec cmd
3, Exec cmd exited, no EPOLLHUP event since the file is still open
4, Try to read ptmx fd before close pts fd
4, signal handler get signal SIGCHLD, close the pts fd to trigger EPOLLHUP event
5, EPOLLHUP event is received, send eof message to ttyfd. release exec.

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-09-23 10:56:49 +08:00
Gao feng 330c46cdb2 enter container namespace with opened ns fd
After process exit,the path of pid ns will disappear,
open it first to prohibit ns being released.

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-09-21 10:52:58 +08:00
Gao feng 27f4b56e71 implement hyper_cmd_read_file
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-09-17 20:28:31 +08:00
Gao feng 2262bc18fe accept read raw data from write message
It's difficult to encode the json with special characters such as '"', '>'...
encoding and unicoding these characters will change the length of json message,
it's a pain to get bytes contains these characters from json.

This patch allows to read the bytes contains special character outside the json.
for example:
{"container":"c5f67934326d2ecef59fee62148bc9237e2481cd803cc0760a6406da15f4ee60","file":"/tmp/aaa"}sssssss

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-09-17 16:18:32 +08:00
Gao feng bc0e688f96 implemet hyper_cmd_write_file
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-09-17 00:44:54 +08:00
Gao feng 7d6468f70b introduce hyper_parse_read_file
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-09-15 23:25:25 +08:00
Gao feng ed9a351518 introduce hyper_parse_write_file
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-09-15 23:22:38 +08:00
Gao feng 04a501edb7 parse dns from pod file
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-08-27 22:42:57 +08:00
Gao feng 01f07fb952 remove channel in pod
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-08-27 22:42:57 +08:00
Gao feng 6dc013fc59 hyperStart source code
The files under src directory is the codes of hyperStart,
use autogen.sh && configure && make to generate hyper-initrd.img,
this image will be used to start hyper instance.

Signed-off-by: Gao feng <feng@hyper.sh>
2015-05-28 18:59:34 +08:00