-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathserver_manager.sh
More file actions
48 lines (41 loc) · 838 Bytes
/
server_manager.sh
File metadata and controls
48 lines (41 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
config_file="uwsgi_config.ini"
log_file="./logs/python_crud_uwsgi.log"
status(){
echo -e "\033[41;30m =========status====== \033[0m"
ps -ef |grep $config_file|grep -v grep
}
start() {
echo -e "\033[41;30m ==========start====== \033[0m"
uwsgi --ini $config_file --daemonize $log_file
sleep 1
chmod 666 op_test_01.sock
}
stop() {
echo -e "\033[41;30m ==========stop======= \033[0m"
ps -ef |grep $config_file|grep -v grep|awk '{ if ( $3 == "1" ) print $2 }'|xargs kill -9
}
restart() {
stop;
sleep 1;
start;
status;
}
case "$1" in
'start')
start
;;
'stop')
stop
;;
'status')
status
;;
'restart')
restart
;;
*)
echo "usage: $0 {start|stop|restart|status}"
exit 1
;;
esac