Wednesday, December 10, 2014

Using Kill To Signal a Process By Name / Taming CRAS

Sometimes CRAS (Chromium [OS] Audio Server) runs up the CPU to 100% sometimes even over 100% - if you send the hangup signal, that should save you trouble of needing to reboot:

$ kill -SIGHUP $(read a _< <(ps -eo pid,comm | grep -i cras); echo $a)

(similar to killall -r '.*[cC][Rr][aA][sS].*' -s SIGHUP )

or you can kill bash shell script sub processes like this: 

$ kill -SIGHUP $(ps -ejH | awk '!/bash/{ if ($2 ~ <process gid>) print $1}')

No comments:

Post a Comment