Changes

9 bytes removed ,  20:01, 26 March 2013
renamed sections
Line 1: Line 1: −
This explains the meaning of "external socket is used" error message, and the purpose of <code>--ext-unix-sk</code> option.
+
This explains the meaning of '''external socket is used''' error message, and the purpose of '''<code>--ext-unix-sk</code>''' option.
   −
== Unix socket consistency check ==
+
== Error meaning ==
    
When dumping a process sub-tree, crtools checks that the resulting image is consistent and self-contained, meaning if an object A references another object B, and A goes into dump, then B should be dumped as well. For example, if there is a pipe, and crtools dumps its one end (object A) because it belongs to a process it dumps, it must also dump the other end of the pipe (object B), meaning it should take a process owning B into the image as well. Same is true for unix sockets: if there is a socket (A) that is <code>connect()</code>ed to another socket (B), and crtools dumps socket A (because it is opened by a process it dumps), it must also dump socket B and the task who owns it. Possibly socket B is dumped some time later in the dumping process, but it must be dumped.
 
When dumping a process sub-tree, crtools checks that the resulting image is consistent and self-contained, meaning if an object A references another object B, and A goes into dump, then B should be dumped as well. For example, if there is a pipe, and crtools dumps its one end (object A) because it belongs to a process it dumps, it must also dump the other end of the pipe (object B), meaning it should take a process owning B into the image as well. Same is true for unix sockets: if there is a socket (A) that is <code>connect()</code>ed to another socket (B), and crtools dumps socket A (because it is opened by a process it dumps), it must also dump socket B and the task who owns it. Possibly socket B is dumped some time later in the dumping process, but it must be dumped.
Line 9: Line 9:  
With that said, "external socket is used" error means crtools detected a unix socket connected to another socket which is not being dumped (because it belongs to a process not going into the image).
 
With that said, "external socket is used" error means crtools detected a unix socket connected to another socket which is not being dumped (because it belongs to a process not going into the image).
   −
== Using --ext-unix-sk ==
+
== Using the option ==
    
However, sometimes it is possible to dump and successfully restore only one end of a unix socket pair. One particular example is the <code>logd</code>, a daemon which opens a datagram unix socket and waits on it for messages to be written into a log file. Processes using logd also create datagram unix sockets and connect those to the logd socket. These connections are thus uni-directional, meaning that the logd's socket remains unconnected. In this case it is possible to dump a program using logd as a client. For it to work after restore its socket needs to be reconnected back to logd using the logd's socket name.
 
However, sometimes it is possible to dump and successfully restore only one end of a unix socket pair. One particular example is the <code>logd</code>, a daemon which opens a datagram unix socket and waits on it for messages to be written into a log file. Processes using logd also create datagram unix sockets and connect those to the logd socket. These connections are thus uni-directional, meaning that the logd's socket remains unconnected. In this case it is possible to dump a program using logd as a client. For it to work after restore its socket needs to be reconnected back to logd using the logd's socket name.