JIRA HPCC-12093 added 'kill_process_by_name()', 'kill_component()', clea...

Kill init_<component>
Kill component processes
I just don't see how this particular routine can handle killing multiple thorslave processes.  To do that I think we would need a while loop, such as like -

kill_process_by_name() {

   process_name=$1
   signal=$2

   [ -z "$signal" ] && signal=15

   pid_comm=$(ps -e -o pid,comm | grep $process_name)

   printf '%s\n' "$pid_comm" | while read _pid _pname
   do
      if [ "$process_name" = "$_pname" ]
      then
         [ -n "$_pid" ] && kill -${signal} $_pid
      fi
   done

}

In my simple tests this change is required to kill all thorslave_lcr processes.