Skip to content

Commit

Permalink
Start, stop and status shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
FRENNSDEVELOPMENT committed Mar 30, 2019
1 parent 3cfa880 commit 82422d5
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 0 deletions.
Empty file added 0
Empty file.
36 changes: 36 additions & 0 deletions nohup.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Traceback (most recent call last):
File "app.py", line 24, in <module>
from flaskext.mysql import MySQL
ImportError: No module named 'flaskext'
Traceback (most recent call last):
File "app.py", line 24, in <module>
from flaskext.mysql import MySQL
ImportError: No module named 'flaskext'
Traceback (most recent call last):
File "app.py", line 24, in <module>
from flaskext.mysql import MySQL
ImportError: No module named 'flaskext'
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: on
2019-03-30 08:44:11,665 - werkzeug - INFO - * Running on http://127.0.0.1:4998/ (Press CTRL+C to quit)
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: on
2019-03-30 08:44:39,924 - werkzeug - INFO - * Running on http://127.0.0.1:4998/ (Press CTRL+C to quit)
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: on
2019-03-30 08:46:00,916 - werkzeug - INFO - * Running on http://127.0.0.1:4998/ (Press CTRL+C to quit)
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: on
2019-03-30 08:48:42,838 - werkzeug - INFO - * Running on http://127.0.0.1:4998/ (Press CTRL+C to quit)
2 changes: 2 additions & 0 deletions runAPI.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source api_venv/bin/activate
python3 app.py
54 changes: 54 additions & 0 deletions service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

#set -x

PID=`netstat -napt| grep LISTEN | grep 4998 | awk {'print $7'} | cut -d'/' -f1`
option="${1}"


case ${option} in

stop)




if [[ -f /proc/$PID/exe ]]
then
kill -9 $PID
echo "app stoped"
echo $PID killed

else
echo " app is aluready stopped. "
fi





;;

start)
if [ $PID > 0 ]; then
echo " app is running please stop it first"
else

# cd /var/www/vhosts/vkingsolutions.com/public_html/clearsight.live/APIcode
source api_venv/bin/activate
nohup python3 app.py &
sleep 5
fi
;;

status )
if [[ $PID > 0 ]]; then
echo " app is running in PID $PID "
else
echo "app is not running"
fi

;;
*)
echo "please use start|stop|status"
;;
esac

0 comments on commit 82422d5

Please sign in to comment.