-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start, stop and status shell scripts
- Loading branch information
FRENNSDEVELOPMENT
committed
Mar 30, 2019
1 parent
3cfa880
commit 82422d5
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
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,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) |
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,2 @@ | ||
source api_venv/bin/activate | ||
python3 app.py |
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,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 |