Changes

Jump to navigation Jump to search
531 bytes added ,  13:50, 18 August 2017
no edit summary
Line 1: Line 1:  +
'''NOTE: Information on this page is outdated. Features described here are implemented in [[RPC]].'''
 +
 
Applications want to dump themselves using CRIU software. This page describes how this should be implemented in CRIU.
 
Applications want to dump themselves using CRIU software. This page describes how this should be implemented in CRIU.
   Line 13: Line 15:  
* a CRIU daemon is launched in the background listening to connections to unix socket
 
* a CRIU daemon is launched in the background listening to connections to unix socket
 
* an application, that wants to checkpoint itself opens the connection and asks for it
 
* an application, that wants to checkpoint itself opens the connection and asks for it
 +
** the service gets pid of the process to dump using SO_PEERCREDS socket option. This is improtaint not to ask for pid from the requestor, as malicious user may ask to dump someone else and then study its dumps.
 
* CRIU service spawns a process, that executes regular dump
 
* CRIU service spawns a process, that executes regular dump
 
* while dumping the connection is closed by CRIU, so application may read() the socket to wait for dump end
 
* while dumping the connection is closed by CRIU, so application may read() the socket to wait for dump end
Line 24: Line 27:  
# Paths are better to be transferred as opened files (SCM_CREDS)
 
# Paths are better to be transferred as opened files (SCM_CREDS)
 
# Waiting for socket to get closed by CRIU is good way to wait for checkpoint to complete. In this case CRIU should close the socket after freeze, but before dump to properly dump the half-closed connection in the program.
 
# Waiting for socket to get closed by CRIU is good way to wait for checkpoint to complete. In this case CRIU should close the socket after freeze, but before dump to properly dump the half-closed connection in the program.
 +
# What if applications runs another one and asks to dump itself with kids? In this case the app in question would be able to investigate its sub-task's guts, which would otherwise be impossible.
 +
 +
[[Category: Plans]]

Navigation menu