No description
Find a file
Cyrill Gorcunov f0606bc8d9 tty: Introduce deferred checking of tty sids
The dumping of tty peers is somewhat tricky. And it became more
complex once we allowed to migrate/inherit sessions.

It's being found (in screen c/r) that we've a problem in looking
up of session leaders while dumping tty.

Let me explain with more details. Here is an example of screen
session

  PID   GID   SID
20567 20567 20567           SCREEN
20568 20568 20568  pts/3     \_ /bin/bash

The screen opens master peer (ptmx) and then provides
bash the slave peer (pts/3) where bash sets up a session
leader on it.

Thus we get interesting scenario -- our pstree construction
is done in lazy fashion, we run parasite code to fetch sid/pgid
of a process tree item only when we're really dumping the task.

Thus when we start dumping ptmx peer (which belongs to SCREEN)
we've not yet constructed the process tree item for children
(ie /bin/bash) and the lookup function in tty code (which walks
over all process items in a tree) simply fails to find sid of
child, because we've not yet dumped it.

Thus, to resolve such situation we verify tty sids at late stage
of dumping.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-29 13:37:34 +04:00
Documentation docs: Update documentation 2012-10-18 19:47:17 +04:00
include tty: Introduce deferred checking of tty sids 2012-10-29 13:37:34 +04:00
protobuf memory: Add pasing of VmFlags 2012-10-26 00:16:05 +04:00
test app-test: java -- Use --shell-job option 2012-10-29 13:35:34 +04:00
.gitignore Update .gitignore 2012-07-09 15:03:38 +04:00
.mailmap repo: Add mailmap file 2012-03-25 23:31:20 +04:00
COPYING Add COPYING file 2011-12-05 14:11:05 +04:00
cr-check.c check: Add check_tty 2012-09-12 20:00:56 +04:00
cr-dump.c tty: Introduce deferred checking of tty sids 2012-10-29 13:37:34 +04:00
cr-restore.c fix many unclosed file opened by open_image_ro 2012-10-24 16:51:50 +04:00
cr-show.c fix many unclosed file opened by open_image_ro 2012-10-24 16:51:50 +04:00
CREDITS Add the CREDITS file 2012-07-30 13:52:37 +04:00
crtools.c options: Add "--shell-job" option 2012-10-18 15:51:57 +04:00
eventfd.c eventfd: Add LOG_PREFIX 2012-08-20 15:14:43 +04:00
eventpoll.c files: Hide pslist selection logic into file desc handlers 2012-09-14 21:53:51 +04:00
fifo.c fd: Remove per-filetype make_gen_id abstraction 2012-08-11 22:41:29 +04:00
file-ids.c protobuf: Start switching our image entries to Google's protobuf 2012-07-17 07:10:41 +04:00
files-reg.c fix many unclosed file opened by open_image_ro 2012-10-24 16:51:50 +04:00
files.c fix many unclosed file opened by open_image_ro 2012-10-24 16:51:50 +04:00
gen-offsets.sh make: Generate offsets from linked files only 2012-04-18 18:22:15 +04:00
image.c tty: Add show method 2012-09-12 20:00:55 +04:00
inotify.c inotify: Add LOG_PREFIX 2012-08-20 15:14:57 +04:00
ipc_ns.c ipc_ns: close file immediately when we don't need it 2012-10-26 00:08:47 +04:00
kcmp-ids.c parasite: remove excessive header deps from parasite.h and friends 2012-05-30 12:50:18 +04:00
libnetlink.c code: A little but more checkpatch fixes over code 2012-08-11 22:19:34 +04:00
log-simple.c log: Introduce a simple printf-like logging engine 2012-10-07 21:06:46 +04:00
log.c log: Move default loglevel macro to header 2012-10-07 21:03:53 +04:00
Makefile tty: Add checkpoint/restore for unix terminals v6 2012-09-12 20:00:54 +04:00
Makefile.inc make: Move common definitions to Makefile.inc 2012-09-02 00:58:37 +04:00
Makefile.pie parasite: Use simple logging engine 2012-10-07 21:12:40 +04:00
Makefile.syscall make: Disable stack executable bit 2012-07-20 19:39:25 +04:00
mount.c fix many unclosed file opened by open_image_ro 2012-10-24 16:51:50 +04:00
namespaces.c crtools: use a special function for executing external utils 2012-09-28 14:09:58 +04:00
net.c fix many unclosed file opened by open_image_ro 2012-10-24 16:51:50 +04:00
netfilter.c sockets, inet: Use inet_sk_entry as a reference in inet_sk_info 2012-07-16 07:03:59 +04:00
parasite-head-x86-64.S parasite: Move bootstrap code into parasite-head-x86-64.S 2012-04-18 18:22:52 +04:00
parasite-syscall.c tty: Sanitize tty parasite-side dumping 2012-10-15 23:55:34 +04:00
parasite.c tty: parasite -- Add support for new kernel ioctls to fetch state 2012-10-29 13:36:46 +04:00
pie.lds.S make: Generate offsets from linked files only 2012-04-18 18:22:15 +04:00
pipes.c files: Formalize fd restore priorities 2012-09-14 22:09:22 +04:00
proc_parse.c memory: Add pasing of VmFlags 2012-10-26 00:16:05 +04:00
protobuf.c protobuf: Fix show of nested messages in pretty format 2012-10-12 20:48:32 +04:00
pstree.c pstree: Allow to dump and restore session non-leaders if --shell-job passed 2012-10-18 15:51:58 +04:00
ptrace.c Helper for si_code event extraction. 2012-04-25 21:35:40 +04:00
rbtree.c code: Fix spaced indentation where found 2012-08-11 21:36:03 +04:00
README Drop kernel patching from README 2012-01-29 16:26:36 +04:00
restorer.c restore: Do madvise() on VMAs where provided 2012-10-26 00:16:06 +04:00
shmem.c shmem: Get rid of static array of dumped shmem areas 2012-08-17 00:20:58 +04:00
signalfd.c fd: Remove per-filetype make_gen_id abstraction 2012-08-11 22:41:29 +04:00
sk-inet.c inet: Disable dumping of shutdown sockets 2012-10-24 18:39:54 +04:00
sk-packet.c show: Show netdevice indices with %d 2012-08-21 16:47:32 +04:00
sk-queue.c fix many unclosed file opened by open_image_ro 2012-10-24 16:51:50 +04:00
sk-tcp.c tcp: save and restore rcv_wscale (v2) 2012-09-19 16:17:11 +04:00
sk-unix.c unix: Lost master socket opts restore 2012-10-24 22:12:57 +04:00
sockets.c sk: Support SO_BINDTODEVICE option 2012-10-19 17:36:44 +04:00
syscall-common-x86-64.S syscalls: Complete redesign v9 2012-04-18 18:23:19 +04:00
syscalls-x86-64.sh syscalls: Complete redesign v9 2012-04-18 18:23:19 +04:00
sysctl.c parasite: remove excessive header deps from parasite.h and friends 2012-05-30 12:50:18 +04:00
tty.c tty: Introduce deferred checking of tty sids 2012-10-29 13:37:34 +04:00
util-net.c fown: get pid and uid-s from parasite 2012-09-05 16:41:14 +04:00
util.c files: rework a function for closing all descriptors (v2) 2012-09-29 11:01:53 +04:00
uts_ns.c code: Remove trailing whitespaces over .c and .h files 2012-08-11 21:34:35 +04:00

crtools
=======

An utility to checkpoint/restore tasks.

Some code snippets are borrowed from

 - Linux kernel (http://kernel.org/)
 - git (http://git-scm.com/)
 - kvm-tools (https://github.com/penberg/linux-kvm)
 - ptrace-parasite (https://code.google.com/p/ptrace-parasite/)

Many thanks to these projects.

Licensed under GPLv2 (http://www.gnu.org/licenses/gpl-2.0.txt)