Changes

622 bytes added ,  11:03, 12 April 2013
no edit summary
Line 1: Line 1:  +
= Dumping a simplest process in a new session without controll terminal =
 
  $ cat > test.sh <<-EOF
 
  $ cat > test.sh <<-EOF
 
  #!/bin/sh
 
  #!/bin/sh
Line 11: Line 12:  
  [2] 2220
 
  [2] 2220
 
  [2]+  Done                    setsid ./test.sh < /dev/null &>test.log
 
  [2]+  Done                    setsid ./test.sh < /dev/null &>test.log
 +
    
  $  ps -C test.sh
 
  $  ps -C test.sh
Line 29: Line 31:  
  OK
 
  OK
    +
= Dumping one shell job =
 +
Now let's try to dump a program, which is using a terminal. For that we need to execute our test script or another program (e.g. "top") from a terminal without redirections. It will report date and time every second.
 
  $ ./test.sh
 
  $ ./test.sh
 
  $ ps -C test.sh
 
  $ ps -C test.sh
Line 34: Line 38:  
   2621 pts/1    00:00:00 test.sh
 
   2621 pts/1    00:00:00 test.sh
    +
Currently crtools doesn't support a stopped task, so "crtools dump" must be executed from another terminal.
 
  $  ~/crtools/crtools dump -t 2621
 
  $  ~/crtools/crtools dump -t 2621
 
  (00.012929) Error (tty.c:1022): tty: Found dangling tty with sid 940 pgid 2621 (pts) on peer fd 0. Consider using --shell-job option.
 
  (00.012929) Error (tty.c:1022): tty: Found dangling tty with sid 940 pgid 2621 (pts) on peer fd 0. Consider using --shell-job option.
 
  (00.013111) Error (cr-dump.c:1636): Dumping FAILED.
 
  (00.013111) Error (cr-dump.c:1636): Dumping FAILED.
 +
crtools asks to set the option --shell-job, because we try to dump only a part of session and a slave point of a tty pair. It's a common rule to ask a user, if only a part of something is dumped.
 
  $ ~/crtools/crtools dump -vvvv -o dump.log -t 2621 --shell-job && echo Ok
 
  $ ~/crtools/crtools dump -vvvv -o dump.log -t 2621 --shell-job && echo Ok
 
  Ok
 
  Ok