Commit 98ea81e65956cb37fc67c03e3a88c29c6932b12c
Committed by
Rovanion Luckey
1 parent
cda4d688
Exists in
master
and in
4 other branches
Restart works again, grammar mistakes corrected.
Showing
1 changed file
with
16 additions
and
5 deletions
Show diff stats
lib/support/init.d/gitlab
@@ -188,7 +188,11 @@ stop() { | @@ -188,7 +188,11 @@ stop() { | ||
188 | 188 | ||
189 | # Returns the status of GitLab and it's components | 189 | # Returns the status of GitLab and it's components |
190 | status() { | 190 | status() { |
191 | - exit_if_not_running | 191 | + check_status |
192 | + if [ "$web_status" != "0" -a "$sidekiq_status" != "0" ]; then | ||
193 | + echo "GitLab is not running." | ||
194 | + return | ||
195 | + fi | ||
192 | if [ "$web_status" = "0" ]; then | 196 | if [ "$web_status" = "0" ]; then |
193 | echo "The GitLab Unicorn webserver with pid $wpid is running." | 197 | echo "The GitLab Unicorn webserver with pid $wpid is running." |
194 | else | 198 | else |
@@ -207,13 +211,13 @@ status() { | @@ -207,13 +211,13 @@ status() { | ||
207 | reload(){ | 211 | reload(){ |
208 | exit_if_not_running | 212 | exit_if_not_running |
209 | if [ "$wpid" = "0" ];then | 213 | if [ "$wpid" = "0" ];then |
210 | - echo "The GitLab Unicorn Web server is not running thus it's configuration can't be reloaded." | 214 | + echo "The GitLab Unicorn Web server is not running thus its configuration can't be reloaded." |
211 | exit 1 | 215 | exit 1 |
212 | fi | 216 | fi |
213 | printf "Reloading GitLab Unicorn configuration... " | 217 | printf "Reloading GitLab Unicorn configuration... " |
214 | kill -USR2 "$wpid" | 218 | kill -USR2 "$wpid" |
215 | echo "Done." | 219 | echo "Done." |
216 | - echo "Restarting GitLab Sidekiq since it isn't capable of reloading it's config..." | 220 | + echo "Restarting GitLab Sidekiq since it isn't capable of reloading its config..." |
217 | RAILS_ENV=$RAILS_ENV bundle exec rake sidekiq:stop | 221 | RAILS_ENV=$RAILS_ENV bundle exec rake sidekiq:stop |
218 | echo "Starting Sidekiq..." | 222 | echo "Starting Sidekiq..." |
219 | RAILS_ENV=$RAILS_ENV bundle exec rake sidekiq:start | 223 | RAILS_ENV=$RAILS_ENV bundle exec rake sidekiq:start |
@@ -222,6 +226,14 @@ reload(){ | @@ -222,6 +226,14 @@ reload(){ | ||
222 | status | 226 | status |
223 | } | 227 | } |
224 | 228 | ||
229 | +restart(){ | ||
230 | + check_status | ||
231 | + if [ "$web_status" = "0" -o "$sidekiq_status" = "0" ]; then | ||
232 | + stop | ||
233 | + fi | ||
234 | + start | ||
235 | +} | ||
236 | + | ||
225 | 237 | ||
226 | ## Finally the input handling. | 238 | ## Finally the input handling. |
227 | 239 | ||
@@ -233,8 +245,7 @@ case "$1" in | @@ -233,8 +245,7 @@ case "$1" in | ||
233 | stop | 245 | stop |
234 | ;; | 246 | ;; |
235 | restart) | 247 | restart) |
236 | - stop | ||
237 | - start | 248 | + restart |
238 | ;; | 249 | ;; |
239 | reload|force-reload) | 250 | reload|force-reload) |
240 | reload | 251 | reload |