Commit efe67a46d7980e93f2fd1eef076d820ab0dff448
1 parent
c5b5a296
Exists in
master
and in
29 other branches
move "is noosfero running?" test to script/production
Showing
2 changed files
with
11 additions
and
1 deletions
Show diff stats
etc/init.d/noosfero
script/production
... | ... | @@ -84,6 +84,12 @@ environments_loop() { |
84 | 84 | fi |
85 | 85 | } |
86 | 86 | |
87 | +do_running() { | |
88 | + pids=$(cat tmp/pids/thin.*.pid 2>/dev/null || true) | |
89 | + # passes if any of $pids exist, fails otherwise | |
90 | + kill -0 $pids > /dev/null 2>&1 | |
91 | +} | |
92 | + | |
87 | 93 | case "$ACTION" in |
88 | 94 | start|stop) |
89 | 95 | do_$ACTION |
... | ... | @@ -100,6 +106,10 @@ case "$ACTION" in |
100 | 106 | do_restart |
101 | 107 | ;; |
102 | 108 | |
109 | + running) | |
110 | + do_running | |
111 | + ;; | |
112 | + | |
103 | 113 | *) |
104 | 114 | echo "usage: $0 start|stop|restart|run" |
105 | 115 | exit 1 | ... | ... |