From ce3079a0e37d4955c19211e010420ba5e1d84fc9 Mon Sep 17 00:00:00 2001 From: gonrial Date: Wed, 2 Dec 2015 20:32:22 -0300 Subject: [PATCH 1/2] Fix the kill error when running for the first time As described in #1 --- makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index eafef7e..4f713f6 100644 --- a/makefile +++ b/makefile @@ -21,8 +21,8 @@ launch: venv shutdown . venv/bin/activate; python services/user.py & shutdown: - ps -ef | grep "services/movies.py" | grep -v grep | awk '{print $$2}' | xargs kill - ps -ef | grep "services/showtimes.py" | grep -v grep | awk '{print $$2}' | xargs kill - ps -ef | grep "services/bookings.py" | grep -v grep | awk '{print $$2}' | xargs kill - ps -ef | grep "services/user.py" | grep -v grep | awk '{print $$2}' | xargs kill + ps -ef | grep "services/movies.py" | grep -v grep | awk '{print $$2}' | xargs -r kill + ps -ef | grep "services/showtimes.py" | grep -v grep | awk '{print $$2}' | xargs -r kill + ps -ef | grep "services/bookings.py" | grep -v grep | awk '{print $$2}' | xargs -r kill + ps -ef | grep "services/user.py" | grep -v grep | awk '{print $$2}' | xargs -r kill From 9687b1a4c071ef39eebedfaaffda1f397ccf2ecf Mon Sep 17 00:00:00 2001 From: gonrial Date: Sun, 6 Dec 2015 17:09:40 -0300 Subject: [PATCH 2/2] XARGS_OPTS to support BSD and Linux systems --- makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/makefile b/makefile index eafef7e..e9eb317 100644 --- a/makefile +++ b/makefile @@ -21,8 +21,8 @@ launch: venv shutdown . venv/bin/activate; python services/user.py & shutdown: - ps -ef | grep "services/movies.py" | grep -v grep | awk '{print $$2}' | xargs kill - ps -ef | grep "services/showtimes.py" | grep -v grep | awk '{print $$2}' | xargs kill - ps -ef | grep "services/bookings.py" | grep -v grep | awk '{print $$2}' | xargs kill - ps -ef | grep "services/user.py" | grep -v grep | awk '{print $$2}' | xargs kill - + echo | xargs -r &>/dev/null && XARGS_OPTS="-r" + ps -ef | grep "services/movies.py" | grep -v grep | awk '{print $$2}' | xargs ${XARGS_OPTS} kill + ps -ef | grep "services/showtimes.py" | grep -v grep | awk '{print $$2}' | xargs ${XARGS_OPTS} kill + ps -ef | grep "services/bookings.py" | grep -v grep | awk '{print $$2}' | xargs ${XARGS_OPTS} kill + ps -ef | grep "services/user.py" | grep -v grep | awk '{print $$2}' | xargs ${XARGS_OPTS} kill