Skip to content

Instantly share code, notes, and snippets.

@kentatogashi
Last active July 22, 2019 14:10
Show Gist options
  • Save kentatogashi/9cc7a5e5c808296bdc0b to your computer and use it in GitHub Desktop.
Save kentatogashi/9cc7a5e5c808296bdc0b to your computer and use it in GitHub Desktop.
Kill zombie process of firefox during the time that you execute automation test through the selenium web driver and the firefox browser
#!/usr/bin/env bash
# Author: Kenta Togashi
INTERVAL=5
COUNT=0
while :
do
sleep $INTERVAL
ZOMBIE_FIREFOX_PID=`ps aux | grep 'firefox' | grep '[-]silent' | awk '{print $2}'`
if [ -n "$ZOMBIE_FIREFOX_PID" ];then
COUNT=`expr $COUNT + 1`
if [ $COUNT -eq 3 ];then
kill -9 $ZOMBIE_FIREFOX_PID
COUNT=0
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment