-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dennis Morello
committed
Sep 29, 2016
1 parent
d262b12
commit 19b01a9
Showing
5 changed files
with
1,139 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
computingenvironments/01.linux/01.centos/01.mahout/algorithms/03.gru/gru.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.