Skip to content

Commit

Permalink
added gru work in folder 03.gru
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Morello committed Sep 29, 2016
1 parent d262b12 commit 19b01a9
Show file tree
Hide file tree
Showing 5 changed files with 1,139 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# chkconfig: 2345 95 20
# description: Mahout recommendation algo example
#
# processname: gru

THIS_HOST_IP=192.168.22.100
LOG=/vagrant/algorithms/03.gru/gru.log
echo "gru service" $1 >> $LOG

case $1 in
status)
status=`ps aux | grep http_flask_server | grep python | wc -l`
echo status $status >> $LOG
$0 start
#exit 0
;;
start)
echo "starting gru service"
cd /vagrant/algorithms/03.gru
ORCH=`netstat -rn | grep "^0.0.0.0 " | cut -d " " -f10`
echo executing nohup python3 /vagrant/algorithms/03.gru/http_flask_server.py >> $LOG
#Sleep 1 at the end to work around vagrant ssh nohup issue (nohup processes are stl shut down on exit)
nohup python3 http_flask_server.py >> $LOG & sleep 1
echo "Started." >> $LOG
;;
stop)
echo "stopping gru service" >> $LOG
pid=`ps aux | grep http_flask_server | grep python | awk '{print $2}'`
kill -9 $pid
;;
esac
exit 0
Loading

0 comments on commit 19b01a9

Please sign in to comment.