mainqndtest
v1.1.1
Last change
on this file since 42095c5 was
42bd667,
checked in by David Fuertes <dfuertes@…>, 4 years ago
|
Historial Limpio
|
-
Property mode set to
100755
|
File size:
1.0 KB
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | # the script should be run |
---|
3 | # from WEB2PY root directory |
---|
4 | |
---|
5 | prog="web2py.py" |
---|
6 | |
---|
7 | chmod +x $prog |
---|
8 | |
---|
9 | function web2py_start { |
---|
10 | nohup python2 ./$prog -a "<recycle>" >>/dev/null 2>/dev/null & |
---|
11 | pid=`pgrep -f $prog | tail -1` |
---|
12 | if [ "x$pid" != "x$$" ] |
---|
13 | then |
---|
14 | echo "WEB2PY has been started (pid $pid). Stop it with '$0 stop'" |
---|
15 | else |
---|
16 | echo "Failed to start WEB2PY." |
---|
17 | fi |
---|
18 | } |
---|
19 | |
---|
20 | function web2py_stop { |
---|
21 | pid="`pgrep -f $prog | grep -v $$`" |
---|
22 | if [ "x$pid" == "x" ] |
---|
23 | then |
---|
24 | echo "No WEB2PY processes to stop." |
---|
25 | else |
---|
26 | kill -15 $pid |
---|
27 | # Wait for web2py to shut down gracefully. |
---|
28 | sleep 2 |
---|
29 | pid="`pgrep -f $prog | head -1`" |
---|
30 | if [ "x$pid" == "x" ] |
---|
31 | then |
---|
32 | echo "WEB2PY has been stopped." |
---|
33 | else |
---|
34 | echo "Failed to stop WEB2PY. (Possibly, only one of several web2py processes was killed.)" |
---|
35 | echo "Still running:" |
---|
36 | pgrep -af $prog |
---|
37 | fi |
---|
38 | fi |
---|
39 | } |
---|
40 | |
---|
41 | case "$1" in |
---|
42 | start) |
---|
43 | web2py_start |
---|
44 | ;; |
---|
45 | stop) |
---|
46 | web2py_stop |
---|
47 | ;; |
---|
48 | restart) |
---|
49 | web2py_stop |
---|
50 | web2py_start |
---|
51 | ;; |
---|
52 | *) |
---|
53 | echo "Usage: $0 [start|stop|restart]" |
---|
54 | ;; |
---|
55 | esac |
---|
56 | |
---|
57 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.