I have a simliar one locally (adapted from killtree found by google) you 
have to pass the killtype

#!/bin/bash

killtree() {
     local _pid=$1
     local _sig=${2:-TERM}
     kill -stop ${_pid} # needed to stop quickly forking parent from 
producing child between child killing and parent killing
     for _child in $(ps -o pid --no-headers --ppid ${_pid}); do
         killtree ${_child} ${_sig}
     done
     echo "killing -${_sig} ${_pid}"
     kill -${_sig} ${_pid}
}

PSID=`ps | grep ruby | sed -e "s/\([0-9]\) .*/\1/g" | head -n1`
echo Killng $PSID

killtree $PSID $@




On 09.01.2014 13:40, Martin Zenzes wrote:
> (killed) correctly on ruby-script-end. This results in running manually


-- 
  Dipl.-Inf. Matthias Goldhoorn
  Space and Underwater Robotic

  Universität Bremen
  FB 3 - Mathematik und Informatik
  AG Robotik
  Robert-Hooke-Straße 1
  28359 Bremen, Germany
  
  Zentrale: +49 421 178 45-6611
  
  Besuchsadresse der Nebengeschäftstelle:
  Robert-Hooke-Straße 5
  28359 Bremen, Germany
  
  Tel.:    +49 421 178 45-4193
  Empfang: +49 421 178 45-6600
  Fax:     +49 421 178 45-4150
  E-Mail:  [email protected]

  Weitere Informationen: http://www.informatik.uni-bremen.de/robotik

_______________________________________________
Rock-dev mailing list
[email protected]
http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev

Reply via email to