Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active March 29, 2016 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/be700c05aae561f7bb87 to your computer and use it in GitHub Desktop.
Save kurozumi/be700c05aae561f7bb87 to your computer and use it in GitHub Desktop.
【シェルスクリプト】ゾンビ化したXvfbプロセスが見つかったたらkillする方法
#!/bin/sh
# 親プロセスID(PPID)が1のXvfbプロセスが見つかったらkillする
isZombie=`ps -ef | grep -v grep | grep Xvfb | awk '$3==1' | wc -l`
if [ $isZombie -gt 0 ];then
kill `ps -ef | grep -v grep | grep Xvfb | awk '$3==1' | awk '{print $2;}'`
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment