Skip to content

Instantly share code, notes, and snippets.

@omar331
Forked from kentatogashi/kill_zombie_firefox
Created December 16, 2016 15:55
Show Gist options
  • Save omar331/656e862ca06349a7d65f47b2697310ec to your computer and use it in GitHub Desktop.
Save omar331/656e862ca06349a7d65f47b2697310ec 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